#include <bits/stdc++.h>
using namespace std;
int n, k, x, t, fr[100005], sv[100005], cnt;
string s;
priority_queue<int> p;
map<string, int> mp;
bool okf, oks;
int main() {
  scanf("%d %d", &n, &k);
  cin >> s;
  x = k;
  for (int i = 0; i < n - 1; ++i) {
    if (s[i] == '4' && s[i + 1] == '7') {
      p.push(-i);
    }
  }
  while (k-- && !p.empty()) {
    t = -p.top();
    p.pop();
    if (t % 2) {
      s[t] = '7';
      if (sv[t] && !oks) {
        x = (cnt + 1) - sv[t];
        k %= x;
        oks = 1;
      }
      if (!oks) sv[t] = ++cnt;
      if (t > 0 && s[t - 1] == '4') {
        p.push(1 - t);
      }
    } else {
      s[t + 1] = '4';
      if (fr[t + 1] && !okf) {
        x = (cnt + 1) - fr[t + 1];
        k %= x;
        okf = 1;
      }
      if (!okf) fr[t + 1] = ++cnt;
      if (s[t + 2] == '7') {
        p.push(-t - 1);
      }
    }
  }
  cout << s << endl;
  return 0;
}
