#include <bits/stdc++.h>
using namespace ::std;
int n, k;
string x;
int main() {
  cin >> n >> k >> x;
  int pos = 0;
  while (k && pos < n) {
    while (pos < n && (x[pos] != '4' || x[pos + 1] != '7')) pos++;
    if (pos == n) break;
    if (pos % 2 == 0) {
      x[pos] = '4';
      x[pos + 1] = '4';
      pos++;
      k--;
    } else {
      x[pos] = '7';
      x[pos + 1] = '7';
      pos--;
      k--;
    }
    if (pos < n - 2) {
      if (pos % 2 == 0 && x[pos] == '4' && x[pos + 1] == '7' &&
          x[pos + 2] == '7') {
        if (k % 2 != 0) x[pos + 1] = '4';
        k = 0;
      }
    }
  }
  cout << x << endl;
  return 0;
}
