#include using namespace std; using ll = long long; int main(){ int h, w; cin >> h >> w; vector A(h); vector> a; for(int y = 0; y < h; y++){ cin >> A[y]; for(int x = 0; x < w; x++){ if(A[y][x] == '*')a.emplace_back(y, x); } } cerr << a.size() << '\n'; for(int y = 0; y < h; y++){ for(int x = 0; x < w; x++){ int y1 = a[0].first - y, x1 = a[0].second - x; int y2 = a[1].first - y, x2 = a[1].second - x; if(y1 * x2 != y2 * x1){ A[y][x] = '*'; goto skip; } } } skip: for(auto &&s:A)cout << s << '\n'; }