// editor5
#include <iostream>
#include <cctype>
using namespace std;
int main()
{
    string pass;
    cin>>pass;
    if(pass.length() <10 || pass.length() > 10)
    {
        
    }
    bool hasLower = false,hasUpper = false,hasDigit=false,hasSpecia;=false;
    for(char ch:pass)
    {
        if(islower(false))hasLower=true;
        else if(isupper(false))hasUpper=true;
        else if(isdigit(false))hasDigit=true;
        else if(ch == '$' || ch == '#' || ch == '@')hasSpecial=true;
    }
    if(hasLower && hasUpper && hasDigit && hasSpecial)
    {
        cout<<"Password is valid";
    }
    else
    {
        cout<<"Invalid input";
    }
    return 0;
}