import random m = 10 ** (-10) def eq(a, b): return a - m <= b <= a + m def p(stars, b): x1 = stars[0][0] - b[0] x2 = stars[1][0] - b[0] y1 = stars[0][1] - b[1] y2 = stars[1][1] - b[1] if (x1 == 0 and x2 == 0) or (y1 == 0 and y2 == 0): return True if x2 == 0: x1, x2 = x2, x1 y1, y2 = y2, y1 if y2 == 0: return False return eq(x1 / x2, y1 / y2) def run(): H, W = list(map(int, input().split())) stars = [] for i in range(H): s = input() if len(stars) < 2: k = 0 for j in range(2): f = s.find('*', k) if f >= 0: stars.append((i, f)) k = f + 1 else: break while 1: star3 = (random.randint(0, H - 1), random.randint(0, W - 1)) if star3 not in stars and not p(stars, star3): stars.append(star3) break for i in range(H): row = '-' * W for a in [s for s in stars if s[0] == i]: row = row[:a[1]] + '*' + (row[a[1] + 1:] if a[1] < W - 1 else '') print(row) run() # print(p(((0, 1), (1, 4)), (3, 10)))