import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int H = sc.nextInt(), W = sc.nextInt(), h[] = new int[2], w[] = new int[2], k = 0; char S[][] = new char[H][W + 1]; for (int i = 0; i < H; ++i) { S[i] = sc.next().toCharArray(); for (int j = 0; j < W && k != 2; ++j) { if (S[i][j] == '*') { h[k] = i; w[k] = j; ++k; } } } sc.close(); if (h[0] == h[1]) { if (h[0] == 0) S[1][0] = '*'; else S[0][0] = '*'; } else { if (w[0] == 0) S[h[0]][1] = '*'; else S[h[0]][w[0] - 1] = '*'; } for (int i = 0; i < H; ++i) System.out.println(S[i]); } }