import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np import random H,W = map(int,readline().split()) S = np.frombuffer(read(),'S1').reshape(H,-1)[:,:W].astype(str) X,Y = np.where(S == '*') def test(x,y): x0,x1 = X-x y0,y1 = Y-y return x0 * y1 != y0 * x1 while True: x = random.randint(0,H-1) y = random.randint(0,H-1) if test(x,y): break S[x][y] = '*' print('\n'.join(''.join(row) for row in S))