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