#include <bits/stdc++.h>
using namespace std;
const long long LINF = ~(((long long)0x1) << 63) / 2;
const int INF = 0X3F3F3F3F;
const double eps = 1e-7;
int main() {
  string s;
  int n;
  int i, j, k, cnt = 0, len;
  cin >> len >> n;
  cin >> s;
  int pos = -1;
  for (i = 0; i < len && n > 0; i++)
    if (s[i] == '4') {
      if (i + 2 < len && i % 2 == 0) {
        if (s[i] == '4' && s[i + 1] == '7' && s[i + 2] == '7' ||
            s[i] == '4' && s[i + 1] == '4' && s[i + 2] == '7') {
          pos = i;
          break;
        }
      }
      if (i + 1 < len) {
        if (s[i] == '4' && s[i + 1] == '7') {
          if (i % 2 == 0) {
            s[i] = '4';
            s[i + 1] = '4';
          } else
            s[i] = '7', s[i + 1] = '7';
          n--;
        }
      }
    }
  if (pos != -1) {
    if (n % 2) {
      if (s[i] == '4' && s[i + 1] == '7' && s[i + 2] == '7')
        s[i] = '4', s[i + 1] = '4', s[i + 2] = '7';
      else
        s[i] = '4', s[i + 1] = '7', s[i + 2] = '7';
    }
  }
  cout << s << endl;
  return 0;
}
