#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long k;
  cin >> n >> k;
  string s;
  cin >> s;
  int p = 0;
  for (long long i = 1; i <= k; i++) {
    while (p < s.length() - 1) {
      if ((s[p] == '4') && (s[p + 1] == '7')) {
        if (p & 1) {
          s[p] = '7';
          p--;
          if (s[p] == '4') {
            if ((k - i) & 1) {
              s[p + 1] = '4';
            }
            cout << s;
            goto exit;
          }
        } else {
          s[p + 1] = '4';
          p++;
        }
        break;
      }
      p++;
    }
    if (p == s.length()) {
      cout << s;
      goto exit;
    }
  }
  cout << s;
exit:
  return (0);
}
