#include<iostream>
#include<string>
#include<cctype>
using namespace std;
bool isvalid(string s) {
    if (s.length() != 19) return false;
    for (int i = 0; i < 19; i++) {
        if (i ==4 || i == 9 || i == 14){
            if(s[i] != '-')return false;
        }
        else{
            if (!isalnum(s[i]) || islower(s[i])) return false;
        }
    }
    return true;
}
int main(){
    string code;
    getline(cin, code);
    if (isValid(code)) cout <<"valid";
    else cout << "Invalid";
    return 0;
}