#include <bits/stdc++.h>
using namespace std;
string s;
void case1(long long int i, long long int k) {
  if (k % 2) {
    s[i + 1] = '7';
  }
  cout << s;
  exit(0);
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, k;
  cin >> n >> k;
  cin >> s;
  for (long long int i = 0; i < n - 1 and k; ++i) {
    if (i + 2 < n and s[i] == '4' and s[i + 1] == '4' and s[i + 2] == '7') {
      if ((i + 1) % 2) case1(i, k);
    }
    if (i + 2 < n and s[i] == '4' and s[i + 1] == '7' and s[i + 2] == '7') {
      if ((i + 1) % 2) {
        s[i + 1] = '4';
        case1(i, k - 1);
      }
    }
    if (s[i] == '4' and s[i + 1] == '7') {
      if ((i + 1) % 2) {
        s[i] = s[i + 1] = '4';
      } else {
        s[i] = s[i + 1] = '7';
      }
      --k;
    }
  }
  cout << s;
}
