def solve(): w, h = map(int, input().split()) px, py, qx, qy = -1, -1, -1, -1 for y in range(w): line = input() idx = line.find("*") if idx >= 0: if px == -1: px, py = idx, y else: qx, qy = idx, y tx, ty = 0, 0 if px == py and qx == qy: tx += 1 if px == 0 and qx == 0: tx += 1 if py == 0 and qy == 0: ty += 1 points = [[px, qx, tx], [py, qy, ty]] for y in range(w): line = "-" * h if y in points[1]: idx = points[1].index(y) line = line[:points[0][idx]] + "*" + line[points[0][idx]+1:] print(line) if __name__=="__main__": solve()