n=io.read"*a":gfind"%S+"i=0 while""do s=" "a=s:rep(i)..n()print(a)b=n():reverse()i=#a-#b print(s:rep(i)..b)end