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