#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  for (int i = 0; i < n and k; i++) {
    if (s[i] == '4' and s[i + 1] == '7') {
      if (i % 2 == 0) {
        s[i] = s[i + 1] = '4';
      } else if (s[i - 1] == '4') {
        if (k % 2 == 0)
          s[i] = '4';
        else
          s[i] = '7';
        break;
      } else
        s[i] = s[i + 1] = '7';
      k--;
    }
  }
  cout << s << endl;
}
