#include using namespace std; namespace { typedef double real; typedef long long ll; template ostream& operator<<(ostream& os, const vector& vs) { if (vs.empty()) return os << "[]"; os << "[" << vs[0]; for (int i = 1; i < vs.size(); i++) os << " " << vs[i]; return os << "]"; } template istream& operator>>(istream& is, vector& vs) { for (auto it = vs.begin(); it != vs.end(); it++) is >> *it; return is; } bool check_rabi(string t) { for (int i = 0; i < t.size(); i++) { if (isdigit(t[i]) || isalpha(t[i])) { return true; } } return false; } map M; void init() { M["digi"] = "nyo"; M["petit"] = "nyu"; M["gema"] = "gema"; M["piyo"] = "pyo"; } bool check(string c, string t) { if (c == "rabi") return check_rabi(t); if (M.count(c) == 0) return false; while (t.back() == ' ') { t.pop_back(); } string last = M[c]; int count = 0; for (int i = t.size() - 1; i >= 0; i--) { if (not (isdigit(t[i]) || isalpha(t[i]))) { count++; } else { break; } } if (count > 3) return false; if (count + last.size() > t.size()) return false; t = t.substr(0, t.size() - count); return t.substr(t.size() - last.size(), last.size()) == last; } void solve() { init(); string s; while (getline(cin, s)) { istringstream is(s); string c; is >> c; string t = s.substr(c.size(), s.size() - c.size()); for (auto& x : t) x = tolower(x); cout << (check(c, t) ? "CORRECT (maybe)" : "WRONG!") << endl; } } } int main() { solve(); return 0; }