#include <bits/stdc++.h>
const int OO = 0x3f3f3f3f;
using namespace std;
void fastt();
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
const int sizee = 1e5 + 5;
int n, k;
char s[sizee];
int main() {
  fastt();
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
  }
  for (int i = 1; i <= n && k; i++) {
    if (i + 1 <= n && i + 2 <= n) {
      string h = "";
      h += s[i];
      h += s[i + 1];
      h += s[i + 2];
      if (h == "477" && i % 2 == 1) {
        if (k % 2 == 1) {
          s[i] = '4', s[i + 1] = '4', s[i + 2] = '7';
        }
        for (int i = 1; i <= n; i++) {
          cout << s[i];
        }
        return 0;
      }
      if (h == "447" && (i + 1) % 2 == 0) {
        if (k % 2 == 1) {
          s[i] = '4', s[i + 1] = '7', s[i + 2] = '7';
        }
        for (int i = 1; i <= n; i++) {
          cout << s[i];
        }
        return 0;
      }
    }
    if (i + 1 <= n) {
      if (s[i] == '4' && s[i + 1] == '7' && i % 2 == 1) {
        s[i + 1] = '4';
        --k;
      }
      if (s[i] == '4' && s[i + 1] == '7' && i % 2 == 0) {
        s[i] = '7';
        --k;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << s[i];
  }
}
void fastt() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); }
