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 not(px == py and qx == qy): tx, ty = px, py tx -= 1 if px > 0 else -1 ty -= 1 if py > 0 else -1 else: tx = px 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()