a,b='*-' S=[input()for x in a*int(input().split()[0])] for i in S: c=i.count(a) if[c,c<1][b.join(S).count(a*2)]:i=i.replace(b,a,1);b=a print(i)