#include <bits/stdc++.h>
using namespace std;
char tmp[200001];
string s;
int n, k, cnt;
int main() {
  scanf("%d%d\n", &n, &k);
  gets(tmp);
  s = tmp;
  if (k == 0) {
    cout << s << endl;
    return 0;
  }
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '4' && s[i + 1] == '7')
      if (i % 2 == 0) {
        s[i + 1] = '4';
        cnt++;
      } else {
        s[i] = '7';
        cnt++;
        if (i > 0 && s[i - 1] == '4') {
          int left = k - cnt;
          if (left % 2 == 0) {
            cout << s << endl;
            return 0;
          } else {
            s[i] = '4';
            cout << s << endl;
            return 0;
          }
        }
      }
    if (cnt == k) break;
  }
  cout << s << endl;
}
