#include using namespace std; using ll = long long; #define rep(i, s, t) for (ll i = s; i < (ll)(t); i++) #define all(x) begin(x), end(x) template bool chmin(T& x, T y) { return x > y ? (x = y, true) : false; } template bool chmax(T& x, T y) { return x < y ? (x = y, true) : false; } struct io_setup { io_setup() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); } } io_setup; void solve() { const string r = "yiwiy9", R = "yiwiY9"; const string l = "9yiwiy", L = "9Yiwiy"; int h, w; cin >> h >> w; rep(lp, 0, h) { string s; cin >> s; rep(i, 0, w - 5) { if (s.substr(i, 6) == r) { s[i + 4] = 'Y'; i += 5; } else if (s.substr(i, 6) == l) { s[i + 1] = 'Y'; i += 5; } } cout << s << "\n"; } } int main() { int t = 1; // cin >> t; while (t--) solve(); }