#! /usr/bin/env python3 H, W = map(int, input().split()) S = [input() for x in range(H)] if len(S) == len(set(S)): for i in range(H): if S[i].count('*') > 0: S[i] = S[i].replace('-', '*', 1) break else: for i in range(H): if not S[i].count('*') > 1: S[i] = S[i].replace('-', '*', 1) break for i in S: print(i)