#include <bits/stdc++.h>
using namespace std;
int match(string &s, int pos) {
  string x = "";
  for (int i = 0; i < 3; i++) {
    if (pos + i >= (int)s.size()) break;
    x += s[i + pos];
  }
  if (x == "477")
    return 1;
  else
    return 0;
}
int check(string &s, int off) {
  for (int i = off; i + 1 < (int)s.size(); i++) {
    if (s[i] == '4' && s[i + 1] == '7') return i;
  }
  return (int)s.size();
}
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int lst = 0;
  while (k > 0) {
    int p = check(s, lst);
    if (p >= (int)s.size()) break;
    if (match(s, p) && p % 2 == 0) k %= 2;
    if (!k) break;
    if (p % 2 == 0)
      s[p] = s[p + 1] = '4';
    else
      s[p] = s[p + 1] = '7';
    lst = p - 1;
    k -= 1;
  }
  cout << s << endl;
  return 0;
}
