#include using namespace std; #ifdef LOCAL #define debug(x) cerr << #x << " = " << (x) << "\n" #else #define debug(x) void(0) #endif typedef long long ll; typedef long double ld; typedef pair Pii; typedef pair Pll; template ostream &operator<<(ostream &os, const vector &v) { for (int i = 0; i < (int)v.size(); i++) os << v[i] << (i + 1 == (int)v.size() ? "" : " "); return os; } template istream &operator>>(istream &is, vector &v) { for (int i = 0; i < (int)v.size(); i++) is >> v[i]; return is; } //////////////////////////////////////////////////////////// int main() { int H, W; cin >> H >> W; vector S(H); cin >> S; 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"); else if (S[i].substr(j, 6) == "9yiwiy") S[i].replace(j, 6, "9Yiwiy"); else j -= 5; j += 5; } for (int i = 0; i < H; i++) cout << S[i] << "\n"; return 0; }