#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, k;
int a[maxn];
bool is = false;
int ind = 0;
int main() {
  cin >> n >> k;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) a[i] = s[i] - '0';
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (cnt == k) break;
    if (a[i] == 4 && a[i + 1] == 7) {
      if ((i + 1) % 2) {
        a[i + 1] = 4;
        cnt++;
      } else {
        a[i] = 7;
        cnt++;
        if (i > 0) {
          if (a[i - 1] == 4) {
            is = true;
            ind = i;
            break;
          }
        }
        i = max(i - 2, -1);
      }
    }
  }
  if (is) {
    if ((k - cnt) % 2) {
      for (int i = 0; i < ind; i++) cout << a[i];
      cout << 4;
      for (int i = ind + 1; i < n; i++) cout << a[i];
    } else {
      for (int i = 0; i < ind; i++) cout << a[i];
      cout << 7;
      for (int i = ind + 1; i < n; i++) cout << a[i];
    }
    return 0;
  }
  for (int i = 0; i < n; i++) cout << a[i];
  return 0;
}
