#include<iostream>
using namespace std;
int main()
{
    string s;
    cin>>s;
    
    try{
        if(s.size()!=14;i++){
            if(i==4||i==9){
                if(s[i]!='-')
                throw"Invalid";
            }
            else if(!((s[i]>='A'&&s[i]<='Z')||(s[i]>='0'&&s[i]<='9')))
                throw"Invalid";
        }
        cout<<"Valid";
    }
    catch(...){
        cout<<"Invalid";
    }
    return 0;
}