#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
int main() {
  int n, k;
  string d;
  cin >> n >> k >> d;
  int count = 0;
  for (int i = 0; i < n - 1 && count < k; ++i) {
    if (d[i] == '4' && d[i + 1] == '7') {
      ++count;
      if (i & 1) {
        d[i] = '7';
        if (d[i - 1] == '4') {
          int left = k - count;
          count = k;
          if (left & 1)
            d[i] = '4';
          else
            d[i] = '7';
        }
      } else {
        d[i + 1] = '4';
      }
    }
  }
  cout << d << endl;
  return 0;
}
