#!ruby -na00F\n rmathn m=Matrix[*$F.map{|l|l.split(" ").map &:to_i}] puts [*m*m.vstack(m*0)].map{|l|l.drop($F.size)*" "}<