#include <bits/stdc++.h>
using namespace std;
const signed long long Infinity = 1000000001;
const long double Pi = 2.0L * asinl(1.0L);
const long double Epsilon = 0.000000001;
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  return os << "(" << p.first << "," << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& V) {
  for (typeof(V.begin()) i = V.begin(); i != V.end(); ++i) os << *i << endl;
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& S) {
  for (typeof(S.begin()) i = S.begin(); i != S.end(); ++i) os << *i << endl;
  return os;
}
template <class T, class U>
ostream& operator<<(ostream& os, const map<T, U>& M) {
  for (typeof(M.begin()) i = M.begin(); i != M.end(); ++i) os << *i << endl;
  return os;
}
map<int, int> M;
int A[1000000];
int n, k;
void readData() {
  scanf("%d %d", &n, &k);
  for (int(i) = (1); (i) <= (n); (i)++) {
    char t;
    scanf("%c", &t);
    if ('0' <= t and t <= '9')
      A[i] = t - '0';
    else
      i--;
  }
}
void solve() {
  int i = 1, t = 1;
  bool W = false;
  while (k > 0) {
    t++;
    while (i < n and !(A[i] == 4 and A[i + 1] == 7)) i++;
    if (i == n) break;
    if (M.find(i) != M.end() and !W) {
      k %= t - M[i];
      W = true;
    } else {
      if (i % 2 == 1)
        A[i + 1] = 4;
      else
        A[i] = 7;
      M[i] = t;
      i = max(i - 2, 1);
      k--;
    }
  }
  int q = 1;
  while (q < n and A[q] == 0) q++;
  while (q <= n) {
    printf("%d", A[q]);
    q++;
  }
}
int main() {
  readData();
  solve();
  return 0;
}
