#include<iostream>
#include<string>
using namespace std;
int main(){
    string password;
    cin>>password;
    
    bool haslower = false, hasupper = false,hasdigit = false,hasspecial=false;
    
    for(char ch : password){
        if(islower(ch))
        hasLower = true;
        else if(isupper(ch))
        hasUpper = true;
        else if(isdigit(ch))
        hasDigit = true;
        else if(ch=='&' || ch== '#' || ch== '@')
        hasSpecial = true;
    }
    if(hasLower && hasUpper && hasDigit && hasSpecial)
    cout<<"Password is valid";
    else
    cout<<"Invalid input";
    return 0;
}