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