#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  long cnt = 0;
  long pos = 0;
  long len = s.length();
  while (pos < len - 1 && cnt < k) {
    if (s[pos] == '4' && s[pos + 1] == '7') {
      if (pos % 2 == 0) {
        s[pos + 1] = '4';
        pos++;
        cnt++;
      } else {
        s[pos] = '7';
        cnt++;
        if (pos > 0 && s[pos - 1] == '4') {
          if ((k - cnt) % 2 == 1) {
            s[pos] = '4';
          }
          break;
        } else {
          pos = pos + 2;
        }
      }
    } else {
      pos++;
    }
  }
  cout << s;
  return 0;
}
