#include<iostream>
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') hasupper=true;
        else if(ch>='0'&&ch>='9') hasdigit=true;
        else if(ch==''&&ch=='#'||ch=='@') hasspecial=true;
    }
    return haslower&&hasupper&&hasdigit&&hasspecial;
}

int main(){
    string password;
    getline(cin, password);
    
    if (validatepassword(password)){
        cout<<"Password is valid"<<endl;
    }
    else{
        cout"Invalid input"<<endl;
    }
    return 0;
}