#include #include using namespace std; bool a[127]; bool solve(string script, string gobi); int main() { for (int i = 32; i < 127; i++){ if (i < 48) a[i] = true; else if (i >= 58 && i <= 64) a[i] = true; else if (i >= 91 && i <= 96) a[i] = true; else if (i >= 123) a[i] = true; } string name; string script; while (getline(cin, script)){ if (script.size() < 5){ cout << "WRONG!" << endl; continue; } name = script.substr(0,5); string gobi; if (name == "digi ") gobi = "nyo"; else if (name + script[6] == "petit ") gobi = "nyu"; else if (name == "rabi "){ for (int i = 0; i < script.size(); i++){ if (!a[script[i]]) { cout << "CORRECT (maybe)" << endl; break; } if (i == script.size() - 1) cout << "WRONG!" << endl; } continue; } else if (name == "gema ") gobi = "gema"; else if (name == "piyo ") gobi = "pyo"; else{ cout << "WRONG!" << endl; continue; } bool b; b=solve(script, gobi); if (b) cout << "CORRECT (maybe)" << endl; else cout << "WRONG!" << endl; } return 0; } bool solve(string script, string gobi){ int cnt=0; for (int i = 1; i < 7; i++){ if (a[script[script.size() - i]]){ cnt++; if (cnt > 3) return false; } else{ for (int j = 0; j < gobi.size();j++){ if (script[script.size() - i - gobi.size() + 1 + j] != gobi[j] && script[script.size() - i - gobi.size() + 1 + j] != gobi[j] - 32){ return false; } } return true; } } }