import itertools def main(): h, w = map(int, input().split()) g = [list(input()) for _ in range(h)] stars = [] for i in range(h): for j in range(w): if g[i][j] == '*': stars.append((i, j)) x0, y0 = stars[0] x1, y1 = stars[1] for x, y in itertools.product(list(range(h)), list(range(w))): if (x0 - x) * (y1 - y) != (y0 - y) * (x1 - x): g[x][y] = '*' break for row in g: print(*row, sep='') if __name__ == "__main__": main()