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