#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const double EPS = 1e-7;
const int INF = 1000000000 + 5;
const int MAXN2 = 3000 + 5;
char s[MAXN];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  scanf("%s", s + 1);
  int cur = 1;
  for (; cur < n && k > 0;) {
    if (s[cur] == '4' && s[cur + 1] == '7') {
      if (cur & 1) {
        s[cur + 1] = '4';
        k--;
      } else {
        if (s[cur - 1] == '4') {
          if (k % 2 == 1) {
            s[cur] = '7';
          }
          break;
        } else {
          s[cur] = '7';
          cur++;
          k--;
        }
      }
    } else
      cur++;
  }
  printf("%s", s + 1);
  return 0;
}
