#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; string OK = "CORRECT (maybe)", NG = "WRONG!"; int who = -1; string tak[5] = {"nyo","nyu","","gema","pyo"}; int f(string &li){ each(c, li)c = tolower(c); if(who == 2){ each(c, li)if(isalnum(c)){ return 1; } } for(int i = sz(li) - sz(tak[who]); i >= 0; --i){ if(i + sz(tak[who]) + 3 < sz(li)){ return 0; } auto sub = li.substr(i, sz(tak[who])); if(sub == tak[who]){ FOR(j, i + sz(tak[who]), sz(li)){ if(isalnum(li[j]))return 0; } return 1; } } return 0; } void solve(string &li){ if(sz(li) < 5){ cout << NG << endl; return; } string s4 = li.substr(0, 4); string s5 = li.substr(0, 5); if(s4 == "digi"){ li = li.substr(4); who = 0; } else if(s5 == "petit"){ li = li.substr(5); who = 1; } else if(s4 == "rabi"){ li = li.substr(4); who = 2; } else if(s4 == "gema"){ li = li.substr(4); who = 3; } else if(s4 == "piyo"){ li = li.substr(4); who = 4; } else{ cout << NG << endl; return; } cout << (f(li) ? OK : NG) << endl; } int main(){ ios::sync_with_stdio(0); cin.tie(0); string li; while(getline(cin, li)){ solve(li); } }