import Data.List r=reverse t=transpose main=interact$(\x->unlines$t$map(r.take(maximum$map length x).(++repeat ' '))x).map(r.filter(/=' ')).t.lines