#include<iostream>
#include<string>
using namespace std;
int main(){
    string password;
    cin>>password;
    bool haslower = false, hasUpper = false, hasDigit = false, hasSpeacial = 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=='@')
        hasSpeacial = true;
    }
    if(hasLower && hasUpper && hasDigit && hasSpeacial)
    cout<<"Password is valid";
    else
    cout<<"Invalid input";
    return 0;
}