-- Practice yukicoder -- author: Leonardone @ NEETSDKASU main = interact $ head . until (null . (!!1)) (until ((/= "treeone") . take 7 . (!!1)) (zipWith ($) [(++ "forest") . head, drop 7 . (!!1)] . repeat) . until (any id.zipWith($)[null, (=="treeone")].repeat.take 7.(!!1)) (zipWith ($) [foldl1 (++) . zipWith ($) [head, take 1 . (!!1)] . repeat, tail . (!!1)] . repeat)) . ([""]++) . words