#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i slope(int y1, int x1, int y2, int x2){ int y = y2 - y1, x = x2 - x1; int g = gcd(abs(y), abs(x)); return {y/g, x/g}; } int main(){ int H, W; cin >> H >> W; vector S(H); rep(i, 0, H) cin >> S[i]; int x1 = -1, y1 = -1, x2 = -1, y2 = -1; rep(y, 0, H) rep(x, 0, W){ if(S[y][x] == '*'){ if(x1 == -1){ x1 = x, y1 = y; }else{ x2 = x, y2 = y; break; } } } int ans_y, ans_x; if(y1 == y2){ rep(y, 0, H) rep(x, 0, W){ if(y == y1 && x == x1) continue; if(y == y2 && x == x2) continue; if(y != y1){ ans_y = y, ans_x = x; break; } } }else if(x1 == x2){ rep(y, 0, H) rep(x, 0, W){ if(y == y1 && x == x1) continue; if(y == y2 && x == x2) continue; if(x != x1){ ans_y = y, ans_x = x; break; } } }else{ auto s1 = slope(y1, x1, y2, x2); rep(y, 0, H) rep(x, 0, W){ if(y == y1 && x == x1) continue; if(y == y2 && x == x2) continue; auto s = slope(y, x, y1, x1); if(s != s1){ ans_y = y, ans_x = x; break; } } } rep(y, 0, H){ rep(x, 0, W){ if(y == ans_y && x == ans_x) cout << "*"; else cout << S[y][x]; } cout << endl; } return 0; }