n="#" while n:c=n;n=["".join(y.replace("#",d)for d in x)for x in map(raw_input,[""]*input())for y in c] print"\n".join(c)