#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"
}