#include<iostream>
#include<string>

using namespace std;

bool validatepassword(const string& password){
    if(password.length()<1||password.length()>10){
        return false;
    }
    
    bool hasLower=false;
    bool hasUpper=false;
    bool hasDigit=false;
    bool hasSpecial=false;
    
    for(char ch:password) {if( ch<="a"&&ch<="z") hasLower= true;
    else if (ch<="A"&&ch<="Z") hasLower= true;
    else if (ch>="0"&&ch<="9") hasLower= true;
    else if(ch=="$"||ch=="#"||ch=="@") hasSpecial= true;
}
return hasLower && hasUpper&&hasDigit&&hasSpecial;
}
int main(){
    string password;
    getline(cin, password);
    
    if (validatepassword(password)){
        cout"Pass =word is valid"<<endl;}
        else{
            cout<<"Invalid input"<<endl;
        }
    }
    return 0;
}