#include <bits/stdc++.h>
using namespace std;
unsigned long long N, K, st[100005], h[100005], i, j, tmp;
char a[100005];
set<unsigned long long> s;
vector<unsigned long long> v;
int start = -1;
bool ok = true;
int main() {
  cin >> N >> K;
  gets(a);
  gets(a);
  st[0] = 1;
  h[0] = a[0];
  if (a[0] == '4' && a[1] == '7') start = 0;
  for (i = 1; i < N; i++) {
    st[i] = st[i - 1] * 73;
    h[i] = (st[i] * a[i]) + h[i - 1];
    if (start == -1 && a[i] == '4' && a[i + 1] == '7') start = i;
  }
  s.insert(h[N - 1]);
  v.push_back(h[N - 1]);
  for (i = 1; i <= K; i++) {
    if (start == -1) {
      puts(a);
      return 0;
    }
    if ((start & 1) == 0) {
      a[start + 1] = '4';
      tmp = h[N - 1] - st[start + 1] * '7' + st[start + 1] * '4';
      h[N - 1] = tmp;
      if (s.find(tmp) != s.end() && ok) {
        for (j = 0; j < v.size(); j++)
          if (v[j] == tmp) break;
        K = (K - j) % (i - j);
        i = 0;
        ok = false;
      } else {
        s.insert(tmp);
        v.push_back(tmp);
      }
      for (j = start; j < N; j++)
        if (a[j] == '4' && a[j + 1] == '7') {
          start = j;
          break;
        }
      if (j == N) start = -1;
    } else {
      a[start] = '7';
      tmp = h[N - 1] - st[start] * '4' + st[start] * '7';
      h[N - 1] = tmp;
      if (s.find(tmp) != s.end() && ok) {
        for (j = 0; j < v.size(); j++)
          if (v[j] == tmp) break;
        K = (K - j) % (i - j);
        i = 0;
        ok = false;
      } else {
        s.insert(tmp);
        v.push_back(tmp);
      }
      start = start >= 1 ? start - 1 : 0;
      for (j = start; j < N; j++)
        if (a[j] == '4' && a[j + 1] == '7') {
          start = j;
          break;
        }
      if (j == N) start = -1;
    }
  }
  puts(a);
  return 0;
}
