#include using namespace std; string to_lower(string s) { for (char &c : s) if (isalpha(c)) c = tolower(c); return s; } bool is_symbol(char x) { return !isalpha(x) && !isdigit(x); } pair split(string s) { int i = 0; while (i < s.size() && s[i] != ' ') i++; if (i == s.size()) return make_pair("", ""); return make_pair(s.substr(0, i), s.substr(i + 1)); } bool is_rabi(string s) { if (s.empty()) return false; for (char c : s) { if (!is_symbol(c)) return true; } return false; } bool check(string s, string tail) { for (int i = 0; i < 4; i++) { if (s.size() < tail.size()) return false; if (s.substr(s.size() - tail.size()) == tail) return true; if (!is_symbol(s.back())) return false; s.pop_back(); } return false; } bool solve(string s) { auto v = split(s); string t = to_lower(v.second); while (t.back() == '\n') t.pop_back(); if (v.first == "digi") { return check(t, "nyo"); } else if (v.first == "petit") { return check(t, "nyu"); } else if (v.first == "rabi") { return is_rabi(t); } else if (v.first == "gema") { return check(t, "gema"); } else if (v.first == "piyo") { return check(t, "pyo"); } else { return false; } } int main() { string s; while (getline(cin, s)) { puts(solve(s) ? "CORRECT (maybe)" : "WRONG!"); } }