#include <bits/stdc++.h>
char Str[1000005];
int main() {
  int i, n, k;
  scanf("%d%d\n", &n, &k);
  gets(Str + 1);
  if (k == 0) goto Output;
  for (i = 1; i <= n - 1; ++i) {
    if ((i & 1) && i <= n - 2 && Str[i] == '4') {
      if (Str[i + 1] == '7' && Str[i + 2] == '7') {
        k %= 2;
        if (k > 0) Str[i + 1] = '4';
        goto Output;
      }
      if (Str[i + 1] == '4' && Str[i + 2] == '7') {
        k %= 2;
        if (k > 0) Str[i + 1] = '7';
        goto Output;
      }
    }
    if (Str[i] == '4' && Str[i + 1] == '7') {
      if (i & 1)
        Str[i + 1] = '4';
      else
        Str[i] = '7';
      --k;
      if (k == 0) goto Output;
    }
  }
Output:
  puts(Str + 1);
  return 0;
}
