#include using namespace std; bool ispoyo(char c) { return(!isalpha(c) && !isdigit(c)); } int main() { map< string, string > dump; dump["digi"] = "oyn"; dump["petit"] = "uyn"; dump["gema"] = "ameg"; dump["piyo"] = "oyp"; string buf; while(getline(cin, buf)) { istringstream sss(buf); string T; sss >> T; string K; bool error = false; auto p = dump.find(T); if(p != dump.end()) { reverse(buf.begin(), buf.end()); buf = buf.substr(0, buf.size() - p -> first.size() - 1); int back = 0; while(back < buf.size() && ispoyo(buf[back])) ++back; if(back > 3) { error = true; } else { for(int i = 0; i < buf.size(); i++) { if(isalpha(buf[i])) buf[i] = tolower(buf[i]); } if(buf.substr(back).find(p -> second) != 0) { error = true; } } } else if(T == "rabi") { bool ok = false; buf = buf.substr(5); for(int i = 0; i < buf.size(); i++) { ok |= !ispoyo(buf[i]); } if(!ok) error = true; } else error = true; if(error) cout << "WRONG!" << endl; else cout << "CORRECT (maybe)" << endl; } }