#include //const static double de_PI = 3.14159265358979323846; //const static int de_MOD = 1000000007; //const static int de_MAX = 999999999; //const static int de_MIN = -999999999; inline std::vector Split_String(const std::string &str, const char key) { std::vector result; std::stringstream SS(str); std::string temp; while (std::getline(SS, temp, key)) { result.push_back(temp); } return(result); } int main(void) { //std::ifstream inf("123.txt"); std::cin.rdbuf(inf.rdbuf()); std::string str; while (std::getline(std::cin, str)) { if (str == "") { std::cout << "WRONG!" << std::endl; continue; } std::vector split = Split_String(str, ' '); if (split.size() < 2) { std::cout << "WRONG!" << std::endl; continue; } std::string ed; if (split[0] == "digi") { ed = "nyo"; } else if (split[0] == "petit") { ed = "nyu"; } else if (split[0] == "rabi") { ed = "rabi"; } else if (split[0] == "gema") { ed = "gema"; } else if (split[0] == "piyo") { ed = "pyo"; } else { std::cout << "WRONG!" << std::endl; continue; } str.erase(str.begin(), str.begin() + split[0].length() + 1); std::transform(str.begin(), str.end(), str.begin(), tolower); bool flg = false; if (ed == "rabi") { for (unsigned int i = 0; i < str.length(); i++) { if (std::isalpha(str[i]) || std::isdigit(str[i])) { flg = true; break; } } } else { unsigned int found = str.rfind(ed); if (found != std::string::npos) { if (str.length() - found - ed.length() <= 3) { flg = true; for (unsigned int i = found + ed.length(); i < str.length(); i++) { if (std::isalpha(str[i]) || std::isdigit(str[i])) { flg = false; break; } } } } } if (flg) { std::cout << "CORRECT (maybe)" << std::endl; } else { std::cout << "WRONG!" << std::endl; } } }