#include #include #include #include #include #include #include #include #include #include #include #include #include #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() using namespace std; typedef long long ll; typedef pair pi; typedef pair pl; typedef pair pls; bool check(int n,int m, string str, string word) { string s = " "; bool flag = false; for (int i = str.size() - 1; i >= str.size()-n; i--) { s = str[i] + s; } for (int i = 0; i < s.size(); i++) s[i] = tolower(s[i]); if (s.find(word) != -1) { flag = true; for (int i = s.find(word) + m; i < s.size(); i++) { if (((s[i] >= 'a' && s[i] <= 'z') ||( s[i] >= 'A' && s[i] <= 'Z') || (s[i] >= '0' && s[i] <= '9'))) { flag = false; break; } flag = true; } } return flag; } int main() { string s; while (getline(cin, s)) { string str = ""; bool flag = false; for (int i = 0; i < s.size(); i++) { if (s[i] == ' ')break; str += s[i]; } if (str == "digi") { if (check(6, 3, s, "nyo"))flag = true; else flag = false; } else if (str == "petit") { if (check(6,3, s, "nyu"))flag = true; else flag = false; } else if (str == "rabi") { flag = false; for (int i = 4; i < s.size(); i++) { if ((s[i] >= 'a' && s[i] <= 'z' || s[i] >= 'A' && s[i] << 'Z' || s[i] >= '0' && s[i] <= '9')) { flag = true; break; } } } else if (str == "gema") { if(check(7,4,s,"gema"))flag = true; else flag = false; } else if (str == "piyo") { if (check(6, 3, s, "pyo"))flag = true; else flag = false;; } puts(flag ? "CORRECT (maybe)" : "WRONG!"); } return 0; }