# データ入力
h, w = map(int, input().split())

star_pos = dict()
count = 1
sky = list()
for row in range(h):
	s = input()
	for i, elm in enumerate(s):
		if elm == '*':
			star_pos[count] = (row, i)
			count += 1
	sky.append(list(s))

# 星の追加候補は(0, 0), (1, 0), (0, 1)の3つ
if star_pos[1][0] == star_pos[2][0]:
	if star_pos[1][0] != 0:
		x, y = 0, 0
	else:
		x, y = 0, 1
elif star_pos[1][1] == star_pos[2][1]:
	if star_pos[1][1] != 0:
		x, y = 0, 0
	else:
		x, y = 1, 0
elif star_pos[1][1]*star_pos[2][0] == star_pos[2][1]*star_pos[1][0]:
	x, y = 0, 0
else:
	x, y = 0, 0

sky[y][x] = '*'
for s in sky:
	print(''.join(s))