#include #include #include #include #include int main() { int h, w; std::cin >> h >> w; std::vector v(h); for (int i = 0; i < h; i++) { std::cin >> v[i]; } std::vector count(w); for (int i = 0; i < w; i++) { int c = 0; for (int j = 0; j < h; j++) { if (v[j][i] == '*') { c++; } } count[i] = c; } bool change = false; for (int i = 0; i < w; i++) { if (count[i] != 2) { for (int j = 0; j < h; j++) { if (v[j][i] != '*') { v[j][i] = '*'; change = true; break; } } } if (change) break; } for (int i = 0; i < h; i++) { std::cout << v[i] << std::endl; } return 0; }