#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
const int MAXN = 120000;
const int MAXM = 6000010;
const int INF = 0x3f3f3f3f;
const long long mod = (long long)1 << 32;
const double eps = 1e-8;
const double pi = acos(-1.0);
int n, k;
char s[223456];
vector<int> ve, vee;
int main() {
  ve.clear();
  vee.clear();
  cin >> n >> k;
  cin >> s + 1;
  int flag = -1, num;
  for (int i = 1; i <= n - 1; i++) {
    if (s[i] == '4' && s[i + 1] == '7') ve.push_back(i);
    if ((i & 1) && s[i] == '4' && s[i + 1] == '4' && s[i + 2] == '7' &&
        i != n - 1 && flag == -1) {
      flag = i;
      num = 1;
    }
    if ((i & 1) && s[i] == '4' && s[i + 1] == '7' && s[i + 2] == '7' &&
        i != n - 1 && flag == -1) {
      flag = i;
      num = 2;
    }
  }
  int i;
  for (i = 0; i < ve.size(); i++) {
    if (k == 0) break;
    int x = ve[i];
    if (x >= flag && flag != -1) break;
    if (x & 1)
      s[x + 1] = '4';
    else
      s[x] = '7';
    k--;
  }
  if (k && flag != -1) {
    if ((k % 2 == 1) && num == 1) s[flag + 1] = '7';
    if ((k % 2 == 1) && num == 2) s[flag + 1] = '4';
    printf("%s\n", s + 1);
    return 0;
  }
  for (; i < ve.size(); i++) {
    if (k == 0) break;
    int x = ve[i];
    if (x & 1)
      s[x + 1] = '4';
    else
      s[x] = '7';
    k--;
  }
  printf("%s\n", s + 1);
  return 0;
}
