#include #include #include #include #include #include #include #include #include #include using namespace std; int main() { string line; while (getline(cin, line)) { int spidx = line.find(' '); string name = line.substr(0, spidx); string msg = line.substr(spidx + 1); if (name == "digi") { if (!regex_match(msg, regex(".*nyo([^0-9a-zA-Z]{0,3})$", regex_constants::ECMAScript | regex_constants::icase))) { cout << "WRONG!\n"; } else { cout << "CORRECT (maybe)\n"; } } else if (name == "petit") { if (!regex_match(msg, regex(".*nyu[^0-9a-zA-Z]{0,3}$", regex_constants::ECMAScript | regex_constants::icase))) { cout << "WRONG!\n"; } else { cout << "CORRECT (maybe)\n"; } } else if (name == "rabi") { auto it = find_if(msg.begin(), msg.end(), [](auto &&c) { return !isalnum(c); }); if (it == msg.end()) { cout << "WRONG!\n"; } else { cout << "CORRECT (maybe)\n"; } } else if (name == "gema") { if (!regex_match(msg, regex(".*gema([^0-9a-zA-Z]{0,3})$", regex_constants::ECMAScript | regex_constants::icase))) { cout << "WRONG!\n"; } else { cout << "CORRECT (maybe)\n"; } } else if (name == "piyo") { if (!regex_match(msg, regex(".*pyo[^0-9a-zA-Z]{0,3}$", regex_constants::ECMAScript | regex_constants::icase))) { cout << "WRONG!\n"; } else { cout << "CORRECT (maybe)\n"; } } else { cout << "WRONG!\n"; } } }