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