import java.util.*; import java.io.*; public class Main { static HashSet[] graph; static int n; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] first = br.readLine().split(" ", 2); int h = Integer.parseInt(first[0]); int w = Integer.parseInt(first[1]); int h1 = -1; int w1 = -1; int h2 = -1; int w2 = -1; char[][] field = new char[h][]; for (int i = 0; i < h; i++) { field[i] = br.readLine().toCharArray(); for (int j = 0; j < w; j++) { if (field[i][j] == '*') { if (h1 == -1) { h1 = i; w1 = j; } else { h2 = i; w2 = j; } } } } int h3; int w3; if (h1 == h2) { if (h1 == 0) { h3 = h1 + 1; w3 = w1; } else { h3 = h1 - 1; w3 = w1; } } else { if (w1 == 0) { h3 = h1; w3 = w1 + 1; } else { h3 = h1; w3 = w1 - 1; } } field[h3][w3] = '*'; StringBuilder sb = new StringBuilder(); for (int i = 0; i < h; i++) { sb.append(new String(field[i])).append("\n"); } System.out.print(sb); } }