#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int main() {
  int n, k, x = 0;
  char i[100005];
  scanf("%d%d", &n, &k);
  scanf("%s", i);
  while ((k--) && (x < n - 1)) {
    while ((x < n - 1) && ((i[x] != '4') || (i[x + 1] != '7'))) ++x;
    if (((x < n - 1) && (i[x] == '4') && (i[x + 1] == '7'))) {
      if (x & 1) {
        i[x] = '7';
        if (i[x - 1] == '4') k %= 2;
        --x;
      } else {
        i[x + 1] = '4';
        ++x;
      }
    }
  }
  printf("%s\n", i);
  return 0;
}
