#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k, kol = 0;
  cin >> n >> k;
  string s;
  cin >> s;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    a[i] = s[i] - '0';
  }
  for (long long i = 0; i < n - 1 && k; i++) {
    if (a[i] == 4 && a[i + 1] == 7) {
      if (i % 2 == 0) {
        a[i + 1] = 4;
        k--;
      } else {
        if (i > 0 && a[i - 1] == 4) {
          if (k % 2 == 1) {
            a[i] = 7;
          }
          break;
        }
        a[i] = a[i + 1] = 7;
        k--;
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    cout << a[i];
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
}
