#include <bits/stdc++.h>
using namespace std;
string char_to_str(char c) {
  string tem(1, c);
  return tem;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <class T>
T rand() {
  return uniform_int_distribution<T>()(rng);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  for (long long i = 0; k && i < n - 1; ++i) {
    if (s[i] == '4' && s[i + 1] == '7') {
      if (i % 2 == 0) {
        s[i + 1] = '4';
        --k;
      } else {
        if (i > 0) {
          if (s[i - 1] == '4') {
            if (k % 2 == 1) {
              s[i] = '7';
            } else {
              s[i] = '4';
            }
            k = 0;
          } else {
            s[i] = '7';
            --k;
          }
        } else {
          s[i] = '7';
          --k;
        }
      }
    }
  }
  cout << s;
}
