#include <bits/stdc++.h>
using namespace std;
char s[(500000)];
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", s);
  for (int i = 0; m && i < n;) {
    while (s[i] != '4') i++;
    if (i + 1 >= n || s[i + 1] != '7') {
      i++;
      continue;
    }
    if (i % 2 == 1 && s[i - 1] == '4') {
      m &= 1;
      if (m) s[i] = '7';
      m = 0;
      continue;
    }
    if (i % 2 == 0 && s[i + 2] == '7') {
      m &= 1;
      if (m) s[i + 1] = '4';
      m = 0;
      continue;
    }
    if (i % 2 == 0)
      s[i + 1] = '4';
    else
      s[i] = '7';
    m--, i++;
  }
  puts(s);
  return 0;
}
