#include <bits/stdc++.h>
using namespace std;
signed main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  s = "0" + s + "0";
  for (long long i = 0; i < s.length() - 1; i++) {
    if (k == 0) break;
    if (s[i] == '4' && s[i + 1] == '4' && s[i + 2] == '7' && i % 2) {
      k = k % 2;
      if (k) {
        s[i + 1] = '7';
      }
      k = 0;
    } else if (s[i] == '4' && s[i + 1] == '7' && s[i + 2] == '7' && i % 2) {
      k = k % 2;
      if (k) {
        s[i + 1] = '4';
      }
      k = 0;
    } else if (s[i] == '4' && s[i + 1] == '7' && i % 2) {
      s[i + 1] = '4';
      k--;
    } else if (s[i] == '4' && s[i + 1] == '7') {
      s[i] = '7';
      k--;
    }
  }
  cout << s.substr(1, n);
  return 0;
}
