import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int H = scan.nextInt(); int W = scan.nextInt(); int[]r = new int[3]; int[]c = new int[3]; int idx = 0; char [][]s = new char[H][W]; for(int i = 0; i < H; i++) { for(int j = 0; j < W; j++) { s[i][j] = '-'; } } for(int i = 0; i < H; i++) { String t = scan.next(); for(int j = 0; j < W; j++) { char ch = t.charAt(j); if(ch == '*') { r[idx] = i; c[idx] = j; s[i][j] = '*'; idx++; } } } loop: for(int i = 0; i < H; i++) { for(int j = 0; j < W; j++) { boolean flag = true; if(r[0] == i && c[0] == j || r[1] == i && c[2] == j) { flag = false; continue; } if(r[0] == i && r[1] == i || c[0] == c[1] && c[0] == j) { flag = false; continue; } if((r[0] - c[0]) == (r[1] - c[1]) && i - j == (r[0] - c[0])) { flag = false; continue; } if(flag) { r[2] = i; c[2] = j; break loop; } } } s[r[2]][c[2]] = '*'; for(int i = 0; i < H; i++) { for(int j = 0; j < W; j++) { System.out.print(s[i][j]); } System.out.println(); } } }