n="#" i=input while n:c,n=n,[x.translate([" "*len(y),y]*18)for x in map(i,[""]*int(i()))for y in n] i("\n".join(c))