System.in.eachLine{(a,b)=it.split() s="" a.each{b.each{x->s+=" $it$x"}}println s-/ /}