using System; namespace No380 { class Program { static void Main(string[] args) { string data; while ((data = Console.ReadLine()) != null) { bool judgment = false; if (data.IndexOf(' ') != -1) { string name = data.Substring(0, data.IndexOf(' ')); string word = data.Substring(data.IndexOf(' ')); switch (name) { case "digi": judgment = LineEnd(word.ToLower(), "nyo"); break; case "petit": judgment = LineEnd(word.ToLower(), "nyu"); break; case "rabi": string line = data.Substring(5); judgment = !MarkCheck(line); break; case "gema": judgment = LineEnd(word.ToLower(), "gema"); break; case "piyo": judgment = LineEnd(word.ToLower(), "pyo"); break; } } if (judgment) Console.WriteLine("CORRECT (maybe)"); else Console.WriteLine("WRONG!"); } } static bool LineEnd(string word, string suffix) { if (word.LastIndexOf(suffix) == -1) return false; word = word.Substring(word.IndexOf(suffix)); if (word.Length - suffix.Length - word.LastIndexOf(suffix) > 3) return false; if (word.Length - suffix.Length - word.LastIndexOf(suffix) > 0) return MarkCheck(word.Substring(suffix.Length)); return true; } static bool MarkCheck(string mark) { foreach (char character in mark) if ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".IndexOf(character) == -1) return true; return false; } } }