#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string inp;
  cin >> inp;
  bool found = false;
  for (int i = 0; (i < n - 1) && k; ++i) {
    if (inp[i] == '4' && inp[i + 1] == '7') {
      if (((i + 1) & 1) && (i < n - 2) && (inp[i + 2] == '7')) {
        if (k & 1) inp[i + 1] = '4';
        cout << inp << endl;
        found = true;
        break;
      } else if ((((i + 1) & 1) == 0) && (i) && (inp[i - 1] == '4')) {
        if (k & 1) inp[i] = '7';
        cout << inp << endl;
        found = true;
        break;
      } else if (((i + 1) & 1)) {
        inp[i + 1] = '4';
        --k;
      } else if (((i + 1) % 2) == 0) {
        inp[i] = '7';
        --k;
      }
    }
  }
  if (!found) cout << inp << endl;
  return 0;
}
