A=B=[] System.in.eachLine{!it?B=[]:B<B.any{b->println a.sum{n->b.sum{sprintf'%5d',n*it}}}}