#include using std::cerr, std::cin, std::cout, std::endl, std::fixed, std::flush; #include using std::vector; #include using std::stoi, std::stol, std::string, std::to_string; static_assert(sizeof(long) == 8); int main() { 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 + 5 < W; j++) { if (S[i].substr(j, 6) == "yiwiy9") { S[i].replace(j, 6, "yiwiY9"); j += 5; continue; } if (S[i].substr(j, 6) == "9yiwiy") { S[i].replace(j, 6, "9Yiwiy"); j += 5; continue; } } } for (int i = 0; i < H; i++) { cout << S[i] << '\n'; } return 0; } /* File : ~/kyopro/yukicoder/iwai2/B.cpp Date : 2025/08/09 Time : 13:42:24 */