#include using namespace std; #define fst(t) std::get<0>(t) #define snd(t) std::get<1>(t) #define thd(t) std::get<2>(t) #define unless(p) if(!(p)) #define until(p) while(!(p)) using ll = long long; using P = std::tuple; const int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0, 0, -1, 1, -1, 1, -1, 1}; string line; bool isSymbol(char c){ return !isalnum(c); } bool isDialogueWith(string str, string suffix){ int s = str.size() - 1; while(s >= 0 && isSymbol(str[s])){ --s; } int s_cnt = str.size() - 1 - s; if(s_cnt > 3){ return false; } if(s + 1 < suffix.size()){ return false; } string tail = str.substr(s - suffix.size() + 1, suffix.size()); return tail == suffix; } bool isValid(){ if(line.size() < 5){ return false; } if(line.substr(0, 5) == "digi "){ return isDialogueWith(line.substr(5), "nyo"); }else if(line.substr(0, 5) == "rabi "){ string tail = line.substr(5); return any_of(tail.begin(), tail.end(), [](char c){ return isalnum(c); }); }else if(line.substr(0, 5) == "gema "){ return isDialogueWith(line.substr(5), "gema"); }else if(line.substr(0, 5) == "piyo "){ return isDialogueWith(line.substr(5), "pyo"); }else if(line.size() >= 6 && line.substr(0, 6) == "petit "){ return isDialogueWith(line.substr(6), "nyu"); } return false; } int main(){ std::cin.tie(nullptr); std::ios::sync_with_stdio(false); while(true){ getline(cin, line); if(cin.eof()){ break; } { int i = line.find(" "); if(i != string::npos){ transform(line.begin() + i, line.end(), line.begin() + i, [](char c){ return tolower(c); }); } } if(isValid()){ std::cout << "CORRECT (maybe)" << std::endl; }else{ std::cout << "WRONG!" << std::endl; } } }