#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
long long int binarysearch(long long int l, long long int r, long long int n,
                           vector<long long int> &v) {
  while (l <= r) {
    long long int mid = (r + l) / 2;
    if (v[mid] == n) {
      return mid;
    } else if (v[mid] > n) {
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  return -1;
}
void solve() {
  long long int n, k;
  string s;
  cin >> n >> k >> s;
  for (long long int i = 0; i < n; i++) {
    if (s[i] == '4' and s[i + 1] == '7' and k > 0) {
      if (i % 2 == 0) {
        s[i + 1] = '4';
        k--;
      } else {
        s[i] = '7';
        if (i - 1 >= 0 and s[i - 1] == '4') {
          if (k % 2 == 0) {
            s[i] = '4';
          }
          k = 0;
          break;
        } else {
          k--;
        }
      }
    }
  }
  cout << s << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
