#include static inline constexpr const std::vector& solve(const uint_fast32_t H, const uint_fast32_t W, std::vector& S) noexcept { for (uint_fast32_t i = 0; i != H; ++i) { auto pos_l = S[i].find("9yiwiy"); auto pos_r = S[i].find("yiwiy9"); while (std::min(pos_l, pos_r) != S[i].npos) { if (pos_l < pos_r) S[i][pos_l + 1] = 'Y', pos_l = S[i].find("9yiwiy"); else S[i][pos_r + 4] = 'Y', pos_r = S[i].find("yiwiy9"); } } return S; } static inline void output(const uint_fast32_t H, const uint_fast32_t W, const std::vector& ans) noexcept { for (uint_fast32_t i = 0; i != H; ++i) std::cout << ans[i] << '\n'; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); uint_fast32_t H, W, i; std::cin >> H >> W; std::vector S(H); for (i = 0; i != H; ++i) S[i].reserve(W), std::cin >> S[i]; output(H, W, solve(H, W, S)); return 0; }