#! /usr/bin/env python3 H, W = map(int, input().split()) S = ''.join([input() for x in range(H)]).replace('-', '*', 1) for i in range(H): print(S[i*W:i*W+W])