#include #include #include #include #include #include using namespace std; using ll = long long; using ull = unsigned long long; #define coutY cout << "Yes" << endl; #define coutN cout << "No" << endl; #define FOR(i,l,r) for(int i=l;ir;--i) #define arrIn(arr, start, N) for (int i = (start); i < (N); ++i) cin >> arr[i]; #define arrOut(arr, start, N) for (int i = (start); i < (N); ++i) { cout << arr[i] <<" "; } cout << endl; #define arrCopy(arr1,arr2, start, N) for (int i = (start); i < (N); ++i) arr2[i]= arr1[i]; #define partmax(arr, start, end) *max_element(arr.begin()+start,A.begin()+end); void yn(bool tf) { cout << (tf ? "Yes\n" : "No\n"); } void YN(bool tf) { cout << (tf ? "YES\n" : "NO\n"); } int CTI(char c){return (int)(c-'0');} string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //cout << fixed << setprecision(20) << int gcd(int a, int b){ //最大公約数 if(a%b == 0){ return b; }else{ return gcd(b, a%b); } } int lcm(int a, int b){ //最小公倍数 return a*b / gcd(a, b); } int nibun(const std::vector& arr, int key, int begin, int end) { while (begin <= end) { int mid = (begin + end) / 2; if (arr[mid] == key) { return mid; } else if (arr[mid] < key) { begin = mid + 1; } else { end = mid - 1; } } return -1; } int fabs(int a,int b){ if(a-b>0){ return a-b; }else{ return b-a; } } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); #ifndef ONLINE_JUDGE ifstream in("c_input.txt"); cin.rdbuf(in.rdbuf()); #endif ll H,W; cin >> H >> W; FOR(i,0,H){ string S; cin >> S; FOR(j,0,W-5){ if(S[j]=='y'&&S[j+1]=='i'&&S[j+2]=='w'&&S[j+3]=='i'&&S[j+4]=='y'&&S[j+5]=='9'){ S[j+4]='Y'; j+=5; }else if(S[j]=='9'&&S[j+1]=='y'&&S[j+2]=='i'&&S[j+3]=='w'&&S[j+4]=='i'&&S[j+5]=='y'){ S[j+1]='Y'; j+=5; } } cout << S << endl; } return 0; }