-- https://wiki.c2.com/?OddWordProblem (pointless) import Data.List import Control.Monad split :: [a] -> ([a], [a]) split xs = (g even, g odd) where g f = map fst $ filter (f . snd) $ zip xs [0..] merge :: [a] -> [a] -> [a] merge xs ys = concat $ transpose [xs, ys] oddWords :: [String] -> [String] oddWords w = let (e, o) = split w in merge e (map reverse o) main = (interact $ unwords . oddWords . words) >> putStrLn "."