open System open System.Text.RegularExpressions let ri () = stdin.ReadLine() |> int let ria () = stdin.ReadLine().Split() |> Array.map int type Sol() = member this.Solve() = let okMsg = "CORRECT (maybe)" let ngMsg = "WRONG!" let judgeWords (s :string) = let ss = s.Split() match (ss.[0] ,s,ss) with | ("digi",_,_ ) when Regex.Match(s,"[nN][yY][oO][^a-zA-Z0-9]{0,3}$").Success && ss.Length > 1 -> okMsg | ("petit",_,_ ) when Regex.Match(s,"[nN][yY][uU][^a-zA-Z0-9]{0,3}$").Success && ss.Length > 1 -> okMsg | ("rabi",_,_ ) when ss.Length > 1 && Regex.Match(s.Substring(5),"[a-zA-Z0-9]").Success -> okMsg | ("gema",_,_ ) when Regex.Match(s,"[gG][eE][mM][aA][^a-zA-Z0-9]{0,3}$").Success && ss.Length > 1 -> okMsg | ("piyo",_,_ ) when Regex.Match(s,"[pP][yY][oO][^a-zA-Z0-9]{0,3}$").Success && ss.Length > 1 -> okMsg | (_,_ ,_) -> ngMsg let mutable chk = true let mutable input :string = "" while chk do input <- stdin.ReadLine() chk <- (input = null) |> not if chk then (if input = "" then ngMsg else input |> judgeWords )|> printfn "%s" let mySol = new Sol() mySol.Solve()