#include using namespace std; using ll = long long; #define ALL(a) (a).begin(), (a).end() #define Yes cout << "Yes" << endl #define No cout << "No" << endl #define endl '\n' int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int H, W; cin >> H >> W; for (; H--;) { string S; cin >> S; if (S[0] == '9' && S[1] == 'y') S[1] = 'Y'; for (int i = 0; i < ssize(S) - 1; i++) { if (S[i] == 'y' && S[i + 1] == '9') { S[i] = 'Y'; } } for (int i = 0; i < ssize(S) - 2; i++) { if (S[i] != 'Y' && S[i + 1] == '9' && S[i + 2] == 'y') { S[i + 2] = 'Y'; } } cout << S << endl; } }