#include #define int long long //#define USE_FREOPEN //#define MUL_TEST #define FILENAME "dialogue" using namespace std; void solve() { string s; while (getline(cin,s)) { int n = s.length(); s = ' ' + s; string name = ""; for (int i = 1; s[i] != ' '; i++) name += s[i]; if (name == "rabi") { bool flag = 0; for (int i = 6; i <= n; i++) if (isdigit(s[i]) || isalpha(s[i])) { flag = 1; break; } cout << (flag ? "CORRECT (maybe)\n" : "WRONG!\n"); } else { if (n - name.length() - 1 < 3) { cout << "WRONG!\n"; continue; } if (n - name.length() - 1 < 4 && name == "gema") { cout << "WRONG!\n"; continue; } int pos = n,cnt = 0; while (!isdigit(s[pos]) && !isalpha(s[pos]) && cnt <= 3) { cnt++; pos--; } if (cnt > 3) { cout << "WRONG!\n"; continue; } string ed = ""; for (int i = pos; i >= pos - 2; i--) ed = (char)tolower(s[i]) + ed; if (name == "digi") { cout << (ed == "nyo" ? "CORRECT (maybe)\n" : "WRONG!\n"); } else if (name == "petit") { cout << (ed == "nyu" ? "CORRECT (maybe)\n" : "WRONG!\n"); } else if (name == "piyo") { cout << (ed == "pyo" ? "CORRECT (maybe)\n" : "WRONG!\n"); } else if (name == "gema") { ed = (char)tolower(s[pos - 3]) + ed; cout << (ed == "gema" ? "CORRECT (maybe)\n" : "WRONG!\n"); } else { cout << "WRONG!\n"; } } } } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); #ifdef USE_FREOPEN freopen(FILENAME ".in","r",stdin); freopen(FILENAME ".out","w",stdout); #endif int _ = 1; #ifdef MUL_TEST cin >> _; #endif while (_--) solve(); _^=_; return 0^_^0; }