func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /STACK:256000000 )   using namespace std;   long long mulmod(long long a, long long b, long long MOD) {     if (b == 0) return 0;     long long res = mulmod(a, b >> 1, MOD);     res += res;     res %= MOD;     return (b & 1) ? (a + res) % MOD : res;   }   int gcd(int a, int b) {     while (a != 0 && b != 0) {       if (a > b) {         a %= b;       } else {         b %= a;       }     }     return a + b;   }   long long gcd(long long a, long long b) {     while (a != 0 && b != 0) {       if (a > b) {         a %= b;       } else {         b %= a;       }     }     return a + b;   }   long long next(long long i) {     long long a[13], j = 0;     memset(a, 0, sizeof(a));     while (i != 0) {       a[j] = i % 10;       i /= 10;       j++;     }     bool pp = 0;     for (int k = j - 1; k >= 0; k--) {       if (pp) {         a[k] = 4;         continue;       }       if (a[k] < 4) {         a[k] = 4;         pp = 1;         continue;       }       if (4 < a[k] && a[k] < 7) {         a[k] = 7;         pp = 1;         continue;       }       if (a[k] > 7) {         while (a[k + 1] == 7) {           k++;         }         if (a[k + 1] == 4) {           a[k + 1] = 7;         } else {           a[k + 1] = 4;         }         a[k] = 4;         pp = 1;         continue;       }     }     i = 0;     for (int j = 12; j >= 0; j--) {       i = i * 10 + a[j];     }     return i;   }   int main() {     ios::sync_with_stdio(0);     int n, k;     string s;     cin >> n >> k >> s;     for (int i = 0; i < n - 1; i++) {       if (i < 0) i = 0;       if (k <= 0) break;       if (s[i] ==  4  && s[i + 1] ==  7 ) {         if (i % 2 == 0) {           if (i + 2 < n && s[i + 2] ==  7 ) {             if (k % 2 == 1) {               s[i + 1] =  4 ;             }             k = 0;             break;           } else {             s[i + 1] =  4 ;             k--;           }         } else {           s[i] =  7 ;           i -= 2;           k--;         }       }     }     cout << s;     return 0;   }   