import Data.Char import Data.Bool import Data.List splitBy p xs  | null xs = []  | isPrefixOf p xs = splitBy p (xs \\ p)  | otherwise = if null ps then [xs] else (xs \\ head ps) : splitBy p (head ps) where ps = filter (isPrefixOf p) (tails xs) main = interact $ unlines . map (bool "WRONG!" "CORRECT (maybe)" . daihon) . lines . map toLower daihon str = case head (words str) of "digi" -> let suf = last (splitBy "nyo" (str++"!")) in length suf <=4 && all isSym suf "petit" -> let suf = last (splitBy "nyu" (str++"!")) in length suf <=4 && all isSym suf "rabi" -> any isPunctuation str "gema" -> let suf = last (splitBy "gema" (str++"!")) in length suf <=4 && all isSym suf "piyo" -> let suf = last (splitBy "pyo" (str++"!")) in length suf <=4 && all isSym suf isSym c = (not.isAlpha) c && (not.isDigit) c && isPrint c