import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int H = sc.nextInt(); final int W = sc.nextInt(); boolean[][] block = new boolean[H][W]; for(int i = 0; i < H; i++){ final char[] ins = sc.next().toCharArray(); for(int j = 0; j < W; j++){ block[i][j] = ins[j] == '*'; } } int fst_x = -1, fst_y = -1, snd_x = -1, snd_y = -1; for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ if(!block[i][j]){ continue; } if(fst_x < 0){ fst_x = j; fst_y = i; }else{ snd_x = j; snd_y = i; } } } if(H * W <= 4){ LOOP: for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ if(block[i][j]){ continue; } block[i][j] = true; break LOOP; } } }else{ LOOP: for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ if(block[i][j]){ continue; } if(i == fst_y || i == snd_y){ continue; } if(j == fst_x || j == snd_x){ continue; } block[i][j] = true; break LOOP; } } } for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ System.out.print(block[i][j] ? "*" : "-"); } System.out.println(); } } }