H, W = map(int, raw_input().split()) s = [raw_input() for _ in xrange(H)] st = [] for i in xrange(H): for j in xrange(W): if s[i][j] == '*': st.append((i, j)) flag = False for i in xrange(H): k = '' for j in xrange(W): if (i, j) == (st[0]) or (i, j) == st[1]: k += '*' elif not flag: if i == st[0][0] == st[1][0]: k += '-' continue elif j == st[0][1] == st[1][1]: k += '-' continue elif i - j == st[0][0] - st[0][1] == st[1][0]-st[1][1]: k += '-' continue elif i + j == st[0][0] + st[0][1] == st[1][0]+st[1][1]: k += '-' continue k += '*' flag = True else: k += '-' print k