using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; using System.IO; class Magatro { const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const string abc = "abcdefghijklmnopqrstuvwxyz"; static void Main() { using(var sr=new StreamReader(Console.OpenStandardInput())) { while (!sr.EndOfStream) { string s = sr.ReadLine(); string[] ss = s.Split(' '); string name = ss[0]; List sp = new List(); for(int i = 1; i < ss.Length; i++) { sp.Add(ss[i]); } string speak =ToSmall( string.Join(" ", sp.ToArray())); Console.WriteLine(ans(name, speak)); } } } static string ans(string name,string speak) { bool a = false; switch (name) { case "digi": a = last(speak, "nyo"); break; case "petit": a = last(speak, "nyu"); break; case "rabi": foreach (char c in abc) { if (speak.Contains(c)) { a = true; break; } } for(int i = 0; i <= 9; i++) { if(speak.Contains(i.ToString())) { a = true; break; } } if(speak.Contains(' ')) { a = true; break; } a = false; break; case "gema": a = last(speak, "gema"); break; case "piyo": a = last(speak, "pyo"); break; } if (a) { return("CORRECT (maybe)"); } else { return("WRONG!"); } } static bool last(string S,string last) { int ind = 0; if (S.Length < 3) { return false; } for(int i = 1; i <= 3; i++) { if( abc.Contains(S[S.Length - i])) { break; } ind++; } if (S.Length - ind < last.Length) { return false; } for(int i = 0; i < last.Length; i++) { if (S[S.Length - 1 - ind - i] != last[last.Length - i - 1]) { return false; } } return true; } static string ToSmall(string S) { char[] C = S.ToArray(); for(int i = 0; i < C.Length; i++) { int ind = ABC.IndexOf(C[i]); if (ind >= 0) { C[i] = abc[ind]; } } return new string(C); } } public class Scanner { public string[] S; private int Index; private char Separator; public Scanner(char separator=' ') { Index = 0; Separator = separator; } public string Next() { string result; if (S == null || Index >= S.Length) { S = Line(); Index = 0; } result = S[Index]; Index++; return result; } public string NextLine() { if (Index >= S.Length) { S = Line(); Index = 0; } List res = new List(); for(int i = Index; i < S.Length; i++) { res.Add(S[i]); } Index = S.Length; return string.Join(Separator.ToString(), res.ToArray()); } private string[] Line() { return Console.ReadLine().Split(Separator); } public int NextInt() { return int.Parse(Next()); } public double NextDouble() { return double.Parse(Next()); } public long NextLong() { return long.Parse(Next()); } }