#include #include #include #include using namespace std; typedef pair PII; int main() { int h, w; cin >> h >> w; vector sky(h); vector star; for (int i = 0; i < h; i++) { cin >> sky[i]; for (int j = 0; j < w; j++) { if (sky[i][j] == '*') { star.emplace_back(make_pair(i, j)); } } } int a = star[0].first; int b = star[1].second; if (star[0].first == star[1].first) { a = (a + 1) % h; } else if (star[0].second == star[1].second) { b = (b + 1) % w; } sky[a][b] = '*'; for (auto s : sky) { cout << s << endl; } return 0; }