#include <bits/stdc++.h>
using namespace std;
char str[100500];
struct smth {
  int pos;
  int type;
  int changed;
};
vector<smth> mess;
int main() {
  int n, k;
  cin >> n >> k;
  cin >> str;
  for (int i = 0; i < n - 1; i++) {
    if (str[i] == '4' && str[i + 1] == '7') {
      smth s;
      s.changed = 0;
      if (i % 2 == 0 && i + 2 < n && str[i + 2] == '7') {
        s.pos = i;
        s.type = 2;
      } else if (i % 2 != 0 && i > 0 && str[i - 1] == '4') {
        s.pos = i - 1;
        s.type = 1;
      } else {
        s.pos = i;
        s.type = 0;
      }
      mess.push_back(s);
    }
  }
  int curr = 0;
  for (int i = 0; i < k; i++) {
    if (curr == mess.size()) break;
    if (mess[curr].type == 0) {
      if (mess[curr].pos % 2 == 0)
        str[mess[curr].pos + 1] = '4';
      else
        str[mess[curr].pos] = '7';
      curr++;
    } else if (mess[curr].type == 1) {
      if ((k - i) % 2 != 0) {
        if (mess[curr].changed == 0)
          str[mess[curr].pos + 1] = '7';
        else
          str[mess[curr].pos + 1] = '4';
        mess[curr].changed = (mess[curr].changed + 1) % 2;
      }
      break;
    } else if (mess[curr].type == 2) {
      if ((k - i) % 2 != 0) {
        if (mess[curr].changed == 1)
          str[mess[curr].pos + 1] = '7';
        else
          str[mess[curr].pos + 1] = '4';
        mess[curr].changed = (mess[curr].changed + 1) % 2;
      }
      break;
    }
  }
  cout << str;
  return 0;
}
