#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, K;
  cin >> n >> K;
  string str;
  cin >> str;
  int size = str.size();
  int ss = size - 1;
  int p = 0;
  bool sign = false;
  for (int i = 0; i < ss; i++) {
    if (str[i] == '4') {
      if (str[i + 1] == '7') {
        p = i;
        sign = true;
        break;
      }
    }
  }
  if (!sign) {
    cout << str << endl;
    return 0;
  }
  for (int i = 0; i < K; i++) {
    if (p % 2 == 0) {
      str[p + 1] = '4';
      int k;
      for (k = p + 1; k < ss; k++) {
        if (str[k] == '4' && str[k + 1] == '7') {
          p = k;
          break;
        }
      }
      p = k;
      if (p >= ss) break;
    } else {
      str[p] = '7';
      if (p > 0) {
        if (str[p - 1] == '4') {
          int left = K - i - 1;
          if (left % 2 == 0) {
            cout << str << endl;
            return 0;
          } else {
            str[p] = '4';
            cout << str << endl;
            return 0;
          }
        }
      }
      int k;
      for (k = p + 2; k < ss; k++) {
        if (str[k] == '4' && str[k + 1] == '7') {
          p = k;
          break;
        }
      }
      p = k;
      if (p >= ss) break;
    }
  }
  cout << str << endl;
  return 0;
}
