#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); bool check(const vector &x, const vector &y) { int x1 = x[1] - x[0], x2 = x[2] - x[0]; int y1 = y[1] - y[0], y2 = y[2] - y[0]; return x1 * y2 - y1 * x2 != 0; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int h, w; cin >> h >> w; vector bd(h); REP (i, h) cin >> bd[i]; vector y, x; REP (i, h) REP (j, w) if (bd[i][j] == '*') { y.push_back(i); x.push_back(j); } REP (i, h) REP (j, w) { if (bd[i][j] == '*' || x.size() >= 3) continue; y.push_back(i); x.push_back(j); if (!check(x, y)) { y.pop_back(); x.pop_back(); } } bd[y.back()][x.back()] = '*'; REP (i, h) cout << bd[i] << endl; return 0; }