// ConsoleApplication4.cpp : Defines the entry point for the console application. // //#include "stdafx.h" #include ; #include ; using namespace std; const int maxH = 100; const int maxW = 100; string table[maxH]; int main() { int H, W; cin >> H >> W; for (int i = 0; i < H; ++i) { cin >> table[i]; } int x[2]; int y[2]; int c = 0; for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { if (table[i][j] == '*') { y[c] = i; x[c] = j; ++c; } } } if (x[0] > x[1]) { swap(x[0], x[1]); swap(y[0], y[1]); } int px = -1, py = -1; for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { if (table[i][j] == '*')continue; if (x[0] == x[1] && x[1] == j)continue; if (y[0] == y[1] && y[1] == i)continue; if ((x[0] - x[1])*(x[0] - j) != (y[0] - y[1])*(y[0] - i)) { px = j; py = i; goto out; } } } out: for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { if (i == py&&j == px) cout << '*'; else cout << table[i][j]; } cout << endl; } return 0; }