#!/usr/bin/env python3

import itertools
import random


EPS = 1e-10


def outer_product(v1, v2):
    return v1.real * v2.imag - v1.imag * v2.real


def main():
    h, w = (int(x) for x in input().split())
    is_occupied = [[c == "*" for c in input()] for _ in range(h)]
    s1, s2 = (complex(r, c) for r, c in itertools.product(range(h), range(w))
              if is_occupied[r][c])
    ans = None
    for r, c in itertools.product(range(h), range(w)):
        if is_occupied[r][c]:
            continue
        else:
            s3 = complex(r, c)
            if abs(outer_product(s3 - s1, s3 - s2)) > EPS:
                ans = (r, c)
                break
    is_occupied[ans[0]][ans[1]] = True
    g = ("".join("*" if x else "-" for x in line) for line in is_occupied)
    print(*g, sep="\n")


if __name__ == '__main__':
    main()