import Data.List import Control.Applicative import Control.Monad main = do n <- readLn names <- replicateM n getLine let perm1 = permutations "iaaeuu" perm2 = permutations "nbgmr*" newNames = map (delete '*') [ins c v | v <- perm1, c <- perm2] case newNames of [] -> putStrLn "NO" _ -> putStrLn $ head newNames legal [] = True legal [charo] = charo `elem` "iaeu" legal (charo1 : charo2 : str) = if charo1 `elem` "iaeu" then legal (charo2 : str) else charo2 `elem` "iaeu" && legal str ins [c1, c2, c3, c4, c5, c6] [v1, v2, v3, v4, v5, v6] = [c1, v1, c2, v2, c3, v3, c4, v4, c5, v5, c6, v6]