main=interact$unlines.f.init f(a:d)=zipWith((&).(&)(d>>" "))(d&a)d&(d&a&a)&(a:d&a) x&y=reverse$y:x