#include <bits/stdc++.h>
int main() {
  char lucky[100010], s[100010];
  int i, j, n, k, c;
  scanf("%d%d\n", &n, &k);
  scanf("%s", lucky);
  strcpy(s, lucky);
  for (i = 0, c = 0; i < n && k; i++) {
    if (lucky[i] == '4' && lucky[i + 1] == '7') {
      k--;
      if (i % 2 == 0) {
        lucky[i + 1] = '4';
      } else {
        lucky[i] = '7';
        if (lucky[i - 1] == '4') k %= 2;
        i -= 2;
      }
    }
  }
  printf("%s\n", lucky);
  return 0;
}
