#include #include #include #include using namespace std; #define REP(i,s,e) for (i = s; i <= e; i++) #define rep(i,n) REP (i,0,(int)(n)-1) #define RREP(i,s,e) for (i = s; i >= e; i--) #define rrep(i,n) RREP (i,(int)(n)-1,0) #define INF (int)1e8 #define MOD (int)(1e9+7) typedef long long ll; bool is_symbol(char c) { if ('a' <= c && c <= 'z') return false; if ('A' <= c && c <= 'Z') return false; if ('0' <= c && c <= '9') return false; if (c == ' ') return false; return true; } bool include(string s, string t) { int i, j; rep (i,min((int)s.size()-(int)t.size(),4)) { string sub = s.substr(s.size()-i-t.size(),t.size()); bool ok = true; REP (j,s.size()-i,s.size()-1) ok &= is_symbol(s[j]); if (!ok) continue; transform(sub.begin(),sub.end(),sub.begin(),[](char c) {return tolower(c);}); if (sub == t) return true; } return false; } int main(void) { int i; string name, s; while (cin >> name) { getline(cin,s); bool ok = false; if (name == "digi") ok = include(s,"nyo"); else if (name == "petit") ok = include(s,"nyu"); else if (name == "rabi") for (auto c : s) ok |= is_symbol(c); else if (name == "gema") ok = include(s,"gema"); else if (name == "piyo") ok = include(s,"pyo"); if (ok) cout << "CORRECT (maybe)" << endl; else cout << "WRONG!" << endl; } return 0; }