#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, k;
  cin >> n >> k;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) {
    char c;
    cin >> c;
    a[i] = c - '0';
  }
  long long rem = k;
  for (long long i = 1; i <= n - 1; i++) {
    if (rem == 0) break;
    if (i <= n - 2 and a[i] == 4 and a[i + 1] == 7 and a[i + 2] == 7 and
        i % 2 == 1) {
      if (rem % 2) {
        a[i] = 4;
        a[i + 1] = 4;
        a[i + 2] = 7;
      }
      break;
    }
    if (i <= n - 2 and a[i] == 4 and a[i + 1] == 4 and a[i + 2] == 7 and
        i % 2 == 1) {
      if (rem % 2) {
        a[i] = 4;
        a[i + 1] = 7;
        a[i + 2] = 7;
      }
      break;
    }
    if (a[i] == 4 and a[i + 1] == 7) {
      if (i % 2 == 0)
        a[i] = 7;
      else
        a[i + 1] = 4;
      rem--;
    }
  }
  for (long long i = 1; i <= n; i++) cout << a[i];
  cout << endl;
}
