// editor4
#include<iostream>
#include<string>
using namespace std;
int main()
{
    string p;
    cin >> p;
    bool h = false, ha=false, has=false, hasf=false;
    string s = "$#@";
    if(password.length()<6 || password.length() > 10){
        cout << "Invalid input"<< endl;
        return 0;
        
    }
    for (char c:password){
        if(islower(c))hasLower = true;
        else if (isupper(c))hasUpper = true;
        else if (isdigit(c))hasDigit = true;
        else if (special.find(c)!=string::npos)hasSpecial = true;
    }
    if(hasLower && hasUpper && hasDigit && hasSpecial){
        cout <<"Password is valid"<< endl;
    }
    else
    {
        cout<<"Invalid input" << endl;
    }
    return 0;
}