#include <bits/stdc++.h>
using namespace std;
string s;
int N, C, curr;
set<int> S;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> C;
  cin >> s;
  for (int I = 0; I < N; I++)
    if (s[I] == '4' && s[I + 1] == '7') S.insert(I);
  while (C--) {
    if (S.empty()) break;
    curr = *S.begin();
    if (curr % 2 == 0) {
      s[curr + 1] = '4';
      if (curr + 2 < N && s[curr + 2] == '7') {
        if (C % 2) {
          s[curr + 1] = '7';
        }
        break;
      }
    } else {
      s[curr] = '7';
      if (curr - 1 >= 0 && s[curr - 1] == '4') {
        if (C % 2) {
          s[curr] = '4';
        }
        break;
      }
    }
    S.erase(S.begin());
  }
  cout << s << endl;
}
