#include <bits/stdc++.h>
using namespace std;
template <class T>
void show(T a, int n) {
  for (int i = 0; i < n; ++i) cout << a[i] << ' ';
  cout << endl;
}
template <class T>
void show(T a, int r, int l) {
  for (int i = 0; i < r; ++i) show(a[i], l);
  cout << endl;
}
const int N = 128 * 2;
const int M = 5000;
const int oo = 10000 * 10000 * 10;
int n, m;
char s[110000];
void solve() {
  int i, j, k;
  int d = 0;
  while (m && d < n) {
    if (!(s[d] == '4' && s[d + 1] == '7')) {
      ++d;
    } else {
      if (d > 1 && s[d - 1] == '4' && (d % 2 == 0)) {
        if (m % 2 == 0) {
          ;
        } else {
          s[d] = '7';
        }
        m = 0;
      } else {
        --m;
        if (d % 2 == 1) {
          s[d + 1] = '4';
          ++d;
        } else {
          s[d] = '7';
          ++d;
        }
      }
    }
  }
}
int main() {
  int i, j, cas = 0;
  scanf("%d %d", &n, &m);
  scanf("%s", s + 1);
  solve();
  puts(s + 1);
  return 0;
}
