#include using namespace std; using ll = long long; #ifdef LOCAL #include #else #define debug(...) #endif int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int H, W; cin >> H >> W; vector S(H); for (int i = 0; i < H; i++) cin >> S[i]; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { if (S[i][j] == '.') continue; if (S[i].substr(j, 6) == "yiwiy9") { S[i][j + 4] = 'Y'; j += 5; } if (S[i].substr(j, 6) == "9yiwiy") { S[i][j + 1] = 'Y'; j += 5; } } } for (int i = 0; i < H; i++) cout << S[i] << "\n"; }