-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU import Data.Char (toLower, isAlphaNum) import Data.List (inits, isSuffixOf) main = putStrLn . solve . lines =<< getContents where solve x = unlines ans where h c | isAlphaNum c = toLower c h _ = '.' res True = "CORRECT (maybe)" res False = "WRONG!" make_suffix s = drop (length s) . inits $ s ++ "..." digi_suffix = make_suffix "nyo" petit_suffix = make_suffix "nyu" gema_suffix = make_suffix "gema" piyo_suffix = make_suffix "pyo" g s = res . or . map (`isSuffixOf` s) f "digi" s = g s digi_suffix f "petit" s = g s petit_suffix f "gema" s = g s gema_suffix f "piyo" s = g s piyo_suffix f "rabi" s = res $ any isAlphaNum s f _ _ = res False check k = let (n, t) = span (/= ' ') k in f n (map h t) ans = map check x