#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
string s;
int n, k;
int main() {
  cin >> n >> k;
  cin >> s;
  int kk = k;
  int start = 0;
  for (int(i) = (0); (i) < int(k); ++(i)) {
    int have = 0;
    for (int(j) = (start); (j) < int(n - 1); ++(j)) {
      if (s[j] == '4' && s[j + 1] == '7') {
        have++;
        if (j + 2 < n && s[j + 2] == '7' && (j + 1) % 2) {
          if (kk % 2)
            s[j] = '4', s[j + 1] = '4', s[j + 2] = '7';
          else
            s[j] = '4', s[j + 1] = '7', s[j + 2] = '7';
          cout << s << endl;
          return 0;
        } else {
          if ((j + 1) % 2)
            s[j + 1] = '4', start = j + 1;
          else
            s[j] = '7';
        }
        break;
      }
    }
    kk--;
    if (!have) break;
  }
  cout << s << endl;
  cin.sync();
  cin.get();
  return 0;
}
