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