h,w=gets.split.map{|e| e.to_i} s=STDIN.read.split ps=[] y1=0 s.each{|s2| x1=0 s2.chars{|e| if e=="*" ps<<[y1,x1] end x1+=1 } y1+=1 } h.times{|y| w.times{|x| x1=ps[0][1]-x y1=ps[0][0]-y x2=ps[1][1]-x y2=ps[1][0]-y if x1*y2-x2*y1!=0 ps<<[y,x] break end } if ps.size==3 break end } h.times{|y| w.times{|x| if ps.index([y,x])==nil print "-" else print "*" end } print "\n" }