#include <iostream>
#include <string>
#include <cctype>
using namespace std;

int main() {
    string password;
    getline(cin, password);
    
    bool hasLowercase = false;
    bool hasUppercase = false;
    bool hasDigit = false;
    bool hasSpecial = false;
    
    for (char c : password) {
        if (islower(c)) {
            hasLowercase = true;
        } else if (isupper(c)) {
            hasUppercase = true;
        } else if (isdigit(c)) {
            hasDigit = true;
        } ese if (c == '$' || c == '#' || c == '@') {
            hasSpecial = true;
        }
    }
    
    if (hasLowercase && hasUppercase && hasDigit && hasSpecial) {
        cout << "Password is valid" << endl;
    } else {
        cout << "Invalid input";
    }
    
    return 0;
}