#include using namespace std; #define int long long #define NO { cout << "WRONG!\n"; } #define YES { cout << "CORRECT (maybe)\n"; } string st; bool check(char c) { return !isdigit(c) && !isalpha(c); } signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); map mp; mp["digi"] = "nyo", mp["petit"] = "nyu", mp["gema"] = "gema", mp["piyo"] = "pyo"; while (getline(cin, st) && st != "") { // cout << "st: \"" << st << "\"\n"; int pos = -1; for (int i = (int)st.size() - 1; i >= 0; i -- ) if (st[i] == ' ') pos = i; if (pos == -1) NO string name = st.substr(0, pos); string s = st.substr(pos + 1, (int)st.size() - pos); int cnt = 0; while (s.size() && check(s.back())) cnt ++ , s.pop_back(); // cout << "name: \"" << name << "\"\n"; // cout << "s: \"" << s << "\"\n"; if (name == "rabi") { int cnt = 0; for (auto i : s) if (!check(i)) cnt = 1; if (cnt) YES else NO } else if (mp.count(name)) { for (auto& i : s) i = tolower(i); if (s.size() >= mp[name].size() && s.substr((int)s.size() - mp[name].size(), mp[name].size()) == mp[name]) YES else NO } else NO } return 0; }