#include #include #include #include #include #include #include using namespace std; bool isSymbol(char c) { return isdigit(c) || isalpha(c); } bool check(string s, string gobi) { if(s.size() < gobi.size()) return false; for(int i = 0; i <= 3; i++) { bool flag = true; for(int j = 0; j < gobi.size(); j++) { int p = s.size() - gobi.size() - i + j; if(s[p] != gobi[j]) { flag = false; break; } } for(int j = 0; j < i; j++) { int p = s.size() - 1 - i; if(!isSymbol(s[p])) { flag = false; break; } } if(flag) return true; } return false; } int main() { cin.tie(0); ios::sync_with_stdio(false); string name, s; while(cin >> name) { getline(cin, s); for(int i = 0; i < s.size(); i++) { if('A' <= s[i] && s[i] <= 'Z') s[i] = tolower(s[i]); } bool ok = false; if(name == "digi") { ok = check(s, "nyo"); } else if(name == "petit") { ok = check(s, "nyu"); } else if(name == "rabi") { for(int i = 0; i < s.size(); i++) { if(isSymbol(s[i])) ok = true; } } else if(name == "gema") { ok = check(s, "gema"); } else { ok = check(s, "pyo"); } if(ok) { cout << "CORRECT (maybe)" << endl; } else { cout << "WRONG!" << endl; } } }