#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++; } } } for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (!flag[i][j]) { if ((i != y[0] || i != y[1] || y[0] != y[1]) && (j != x[0] || j != x[1] || x[0] != x[1]) && ((double)y[0] - i) / ((double)y[1] - i) != ((double)x[0] - j) / ((double)x[1] - j)) { ans_x = j; ans_y = i; } } } } 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; }