#include<iostream>
#include<string>
using namespace std;

int main()
{
    string password;
    cin>>password;
    bool hasLower=false,hasUpper=false,hasDigit=false,hasSpecial=false;
    string specialChare="$#@";
    
    for(char c: paasword){
        if (islower(c))
         hasLower=true;
         else if(isupper(c))
         hasUpper=true;
         else if (isdigit(c))
         hasDigit=true;
         else is (specialChars.find(c)!=string::nops)
         hasSpecial=true;
    }
    if(hasLower&& hasUpper&&hasDigit&&hasSpecial&&password.length()>=6&&passsword.length()<=10)
    cout<<"Password is valid";
    else
    cout<<"Invalid input";
    return 0;
}