main=interact$unlines.filter(any(>' ')).f(:).f(&).lines f=($repeat"").foldr.zipWith x&(' ':z)=' ':x&z x&y=x:y