#include <bits/stdc++.h>
const int N = 1000000 + 10;
int n, k;
int a[N];
int read() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  return c - '0';
}
int main() {
  scanf("%d", &n);
  scanf("%d", &k);
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i < n && k; i++) {
    if (a[i] == 4 && a[i + 1] == 7) {
      if (i & 1) {
        if (i + 2 <= n && a[i + 2] == 7) {
          if (k & 1) a[i + 1] = 4;
          k = 0;
        } else
          a[i + 1] = 4, k--;
      } else {
        if (i - 1 >= 1 && a[i - 1] == 4) {
          if (k & 1) a[i] = 7;
          k = 0;
        } else
          a[i] = 7, k--;
      }
    }
  }
  for (int i = 1; i <= n; i++) putchar(a[i] + '0');
  return 0;
}
