#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int main() {
  char str[N];
  long long n, m;
  cin >> n >> m;
  scanf("%s", str + 1);
  int len = strlen(str + 1);
  for (int i = 1; i <= len && m; i++) {
    if (str[i] == '4' && (str[i + 1] == '4' || str[i + 1] == '7') &&
        str[i + 2] == '7' && i % 2 == 1) {
      if (m % 2 == 1) {
        if (str[i + 1] == '4')
          str[i + 1] = '7';
        else
          str[i + 1] = '4';
      }
      break;
    } else if (str[i] == '4' && str[i + 1] == '7' && i % 2 == 1) {
      str[i + 1] = '4';
      m--;
    } else if (str[i] == '4' && str[i + 1] == '7' && i % 2 == 0) {
      str[i] = '7';
      m--;
    }
  }
  printf("%s\n", str + 1);
  return 0;
}
