#include <bits/stdc++.h>
using namespace std;
int N, K;
string S;
set<int> pos;
int main() {
  cin >> N >> K >> S;
  for (int i = 0; i < (int)(N - 1); ++i)
    if (S[i] == '4' && S[i + 1] == '7') pos.insert(i);
  while (K--) {
    if (pos.empty()) break;
    int x = *pos.begin();
    pos.erase(pos.begin());
    if ((x + 1) % 2 == 1) {
      if (x + 2 < N && S[x] == '4' && S[x + 1] == '7' && S[x + 2] == '7') {
        S[x] = '4';
        S[x + 1] = (K % 2) ? '7' : '4';
        S[x + 2] = '7';
        break;
      }
      S[x] = '4';
      S[x + 1] = '4';
      if (x + 2 < N && S[x + 2] == '7') pos.insert(x + 1);
    } else {
      S[x] = '7';
      S[x + 1] = '7';
      if (x - 1 >= 0 && S[x - 1] == '4') pos.insert(x - 1);
    }
  }
  cout << S << endl;
  return 0;
}
