// editor5
#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(p.length()<6||p.length()>10)
    {
        cout<<"Invalid input"<<endl;
        return 0;
    }
    for(char c:p)
    {
        if(islower(c))h=true;
        else if(isupper(c))ha=true;
        else if(isdigit(c))has=true;
        else if(special.find(c)!=string::npos) hasf=true;
    }
    if(h&&ha&&has&&hasf)
    {
        cout<<"Password is valid"<<endl;
    }
    else
    {
        cout<<"Invalid input"<<endl;
    }
    return 0;
}