#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m >> n;
  string str;
  cin >> str;
  string str1;
  str1 = str;
  str = 'a' + str;
  if (n == 0) return !(cout << str1 << endl);
  for (int i = 1; i <= m;) {
    if (str[i - 1] == '4' && str[i] == '4' && str[i + 1] == '7' && i % 2 == 0 &&
        n) {
      if (n % 2) {
        str[i] = '7';
        str[i + 1] = '7';
      }
      break;
    } else if (str[i] == '4' && str[i + 1] == '7' && str[i + 2] == '7' &&
               i % 2 == 1 && n) {
      if (n % 2) {
        str[i + 1] = '4';
      }
      break;
    } else if (str[i] == '4' && str[i + 1] == '7' && n) {
      if (i % 2 == 0) {
        str[i] = '7';
        str[i + 1] = '7';
      } else {
        str[i] = '4';
        str[i + 1] = '4';
      }
      n--;
      i += 2;
    } else
      i++;
  }
  str.erase(str.begin() + 0);
  cout << str << endl;
  return 0;
}
