# -*- coding: utf-8 -*- """ No.455 冬の大三角 https://yukicoder.me/problems/no/455 """ import sys from sys import stdin input = stdin.readline def solve(stars, fields, H, W): x1, y1 = stars[0][0], stars[0][1] x2, y2 = stars[1][0], stars[1][1] x0, y0 = 0, 0 if x1 == x2: x0 = x1 - 1 if x0 < 0: x0 = x1 + 1 y0 = (y1 + y2) // 2 while (x0 == x1 and y0 == y1) or (x0 == x2 and y0 == y2): y0 += 1 else: y0 = y1 -1 if y0 < 0: y0 = y1 + 1 x0 = (x1 + x2) // 2 while (x0 == x1 and y0 == y1) or (x0 == x2 and y0 == y2): x0 += 1 fields[y0][x0] = '*' def main(args): H, W = map(int, input().split()) stars = [] fields = [['-'] * W for _ in range(H)] for y in range(H): row = input().strip() for x, r in enumerate(row): if r == '*': stars.append([x, y]) fields[y][x] = '*' ans = solve(stars, fields, H, W) for row in fields: print(*row, sep='') if __name__ == '__main__': main(sys.argv[1:])