#include <bits/stdc++.h>
char buf[100005];
int main(void) {
  int k, n;
  char *p47, *p447, *pbuf;
  sscanf(gets(buf), "%d %d", &n, &k);
  pbuf = gets(buf);
  for (p47 = strstr(buf, "47"), p447 = strstr(buf, "447");
       p47 != NULL && (p47 < p447 || !((p447 - buf + 1) & 1) || p447 == NULL) &&
       k--;
       pbuf = p47, p47 = strstr(pbuf, "47"), p447 = strstr(pbuf, "447"))
    p47[0] = p47[1] = ((p47 - buf + 1) & 1) ? '4' : '7';
  if ((k & 1) && k > 0 && p447 != NULL) p447[1] = '7';
  printf("%s\n", buf);
  return 0;
}
