#include <bits/stdc++.h>
using namespace std;
const long long oo = 2e9, MOD = 998244353;
int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
int main() {
  int n, k;
  string s;
  cin >> n >> k >> s;
  for (int i = 0; i < (int)s.size() - 1 && k; i++) {
    if (s[i] == '4' and s[i + 1] == '7') {
      if (((i + 1) & 1) and i + 2 < (int)s.size() and s[i + 2] == '7') {
        k %= 2;
        if (k) {
          s[i] = '4', s[i + 1] = '4';
        }
        break;
      }
      if (!((i + 1) & 1) and i - 1 >= 0 and s[i - 1] == '4') {
        k %= 2;
        if (k) {
          s[i] = '7', s[i + 1] = '7';
        }
        break;
      }
      if ((i + 1) & 1) {
        s[i] = '4', s[i + 1] = '4';
      } else {
        s[i] = '7', s[i + 1] = '7';
      }
      k--;
    }
  }
  cout << s;
  return 0;
}
