#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int a[maxn];
char s[maxn];
int main() {
  int n, k;
  while (scanf("%d %d", &n, &k) == 2) {
    scanf("%s", s);
    for (int i = 1; i <= n; i++) a[i] = s[i - 1] - '0';
    int num = 0;
    int now = 1;
    a[0] = 0;
    while (num < k && num < 2 * n) {
      while (now < n && (a[now] != 4 || a[now + 1] != 7)) now++;
      if (now == n) break;
      if (now & 1)
        a[now + 1] = 4;
      else {
        a[now] = 7;
        now--;
      }
      num++;
    }
    if (num != k) {
      int res = (k - num) % 2;
      while (res) {
        while (now < n && (a[now] != 4 || a[now + 1] != 7)) now++;
        if (now == n) break;
        if (now & 1)
          a[now + 1] = 4;
        else {
          a[now] = 7;
          now--;
        }
        res--;
      }
    }
    for (int i = 1; i <= n; i++) printf("%d", a[i]);
    puts("");
  }
  return 0;
}
