#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const double eps = 1e-8;
const long long INF = 0x3f3f3f3f;
const long long maxn = 1e5 + 5;
const long long maxm = 1e6 + 5;
long long n, k, a[maxn];
char s[maxn];
inline long long read();
signed main() {
  n = read(), k = read();
  scanf("%s", s + 1);
  for (long long i = 1; i <= n; ++i) {
    a[i] = s[i] - '0';
  }
  for (long long i = 1; i <= n && k; ++i) {
    if (a[i] == 4 && a[i + 1] == 7 && a[i + 2] == 7 && i % 2) {
      k %= 2;
    }
    if (a[i] == 4 && a[i + 1] == 7 && k) {
      i % 2 ? a[i + 1] = 4 : a[i] = 7;
      i -= 2, k--;
    }
  }
  for (long long i = 1; i <= n; ++i) {
    printf("%d", a[i]);
  }
  return 0;
}
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return x * f;
}
