#include <bits/stdc++.h>
using namespace std;
int const N = 110000;
char input[N];
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) == 2) {
    memset(input, 0, (sizeof input));
    scanf("%s", input);
    int curr = 0;
    for (int n_ = (k), ik = 0; ik < n_; ++ik) {
      while (curr < n && (input[curr] != '4' || input[curr + 1] != '7')) {
        curr++;
      }
      if (curr < n) {
        if (curr % 2 == 0) {
          input[curr + 1] = '4';
          if (input[curr + 2] == '7') {
            ik += (k - (ik + 1)) / 2 * 2;
          }
          curr = curr + 1;
        } else {
          input[curr] = '7';
          if (curr > 0 && input[curr - 1] == '4') {
            ik += (k - (ik + 1)) / 2 * 2;
          }
          if (curr > 0) {
            curr = curr - 1;
          }
        }
      } else {
        break;
      }
    }
    puts(input);
  }
  return 0;
}
