import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int w = sc.nextInt(); char[][] field = new char[h][]; int idx = 0; int[] arr = new int[2]; for (int i = 0; i < h; i++) { field[i] = sc.next().toCharArray(); for (int j = 0; j < w; j++) { if (field[i][j] == '*') { arr[idx] = i * w + j; idx++; } } } if (arr[0] % w == arr[1] % w) { if (arr[0] % w == 0) { field[(arr[0] + 1) / w][(arr[0] + 1) % w] = '*'; } else { field[(arr[0] - 1) / w][(arr[0] - 1) % w] = '*'; } } else { if (arr[0] / w == 0) { field[(arr[0] + w) / w][(arr[0] + w) % w] = '*'; } else { field[(arr[0] - w) / w][(arr[0] - w) % w] = '*'; } } StringBuilder sb = new StringBuilder(); for (char[] tmp : field) { sb.append(new String(tmp)).append("\n"); } System.out.print(sb); } }