#include "iostream" #include "iomanip" #include "math.h" using namespace std; int W, H; char star[1000][1000]; bool flag[1000][1000]; int x[2]; int y[2]; int ans_x; int ans_y; int num; int main() { cin >> H>>W; num = 0; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { cin >> star[i][j]; if (star[i][j] == '*') { flag[i][j] = true; x[num] = j; y[num] = i; num++; } } } if (x[0] == 0 && x[1] == 0) { ans_x = 1; ans_y = 0; } else if (y[0] == 0 && y[1] == 0) { ans_x = 0; ans_y = 1; } else { ans_x = 0; ans_y = 0; } flag[ans_y][ans_x] = true; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (flag[i][j])cout << "*"; else cout << "-"; } cout << "\n"; } return 0; }