#include using namespace std; vector > pos; int main(){ int h, w; cin >> h >> w; char c[h][w]; for(int i = 0; i < h; i++){ for(int j = 0; j < w; j++){ cin >> c[i][j]; if(c[i][j] == '*'){ pos.push_back(make_pair(i, j)); } } } bool ok = false; for(int i = 0; i < h; i++){ for(int j = 0; j < w; j++){ double slope1 = (double)(pos[0].first - i) / (pos[0].second - j); double slope2 = (double)(pos[1].first - i) / (pos[1].second - j); if(ok == false){ if(i != pos[0].first || i != pos[1].first){ if(j != pos[0].second || j != pos[1].second){ if(slope1 != slope2){ cout << "*"; ok = true; }else{ cout << "-"; } }else{ cout << "-"; } }else if(j != pos[0].second || j != pos[1].second){ if(i != pos[0].first || i != pos[1].first){ if(slope1 != slope2){ cout << "*"; ok = true; }else{ cout << "-"; } }else{ cout << "-"; } }else{ printf("-"); } }else{ printf("%c", c[i][j]); } } cout << endl; } }