#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, i, j;
  string m;
  while (scanf("%d %d", &n, &k) != EOF) {
    cin >> m;
    int s = 1, l = -1, sta = 0;
    i = 0;
    for (s = 1; s <= k; s++) {
      for (; i < n - 1; i++) {
        if (m[i] == '4' && m[i + 1] == '7') {
          if (i % 2 == 0) {
            m[i + 1] = '4';
            if (i + 1 < n - 1 && m[i + 2] == '7') {
              l = 2;
              sta = s;
            }
          } else {
            m[i] = '7';
            if (i > 0 && m[i - 1] == '4') {
              l = 2;
              sta = s;
            }
          }
          break;
        }
      }
      if (l != -1 || i == n - 1) break;
    }
    if (s > k || l == -1)
      cout << m << endl;
    else {
      k = k - s;
      k %= 2;
      i -= 1;
      i = max(0, i);
      for (s = 1; s <= k; s++) {
        for (; i < n - 1; i++) {
          if (m[i] == '4' && m[i + 1] == '7') {
            if (i % 2 == 0) {
              m[i + 1] = '4';
            } else {
              m[i] = '7';
            }
            break;
          }
        }
      }
      cout << m << endl;
    }
  }
  return 0;
}
