main :: IO () main = solve <$> getLine >>= putStrLn solve :: String -> String solve s | length s < 7 = s | take 7 s == "treeone" = "forest" ++ (solve $ drop 7 s) | otherwise = [head s] ++ (solve $ tail s)