#include <bits/stdc++.h>
using namespace std;
template <class Ty, class Tx>
Ty cast(const Tx &x) {
  Ty y;
  stringstream ss("");
  ss << x;
  ss.seekg(0);
  ss >> y;
  return y;
}
int a[100005];
string s;
int main() {
  int n, k, i, j, t;
  cin >> n >> k;
  cin >> s;
  for ((i) = 0; (i) < (n); (i)++) a[i] = s[i] - '0';
  for ((i) = 0; (i) < (n - 1); (i)++)
    if (k > 0) {
      if (a[i] == 4 && a[i + 1] == 7) {
        if (i % 2 == 0) {
          if (i + 2 < n && a[i + 2] == 7) {
            if (k % 2 == 1) {
              a[i + 1] = 4;
            }
            k = 0;
          } else {
            a[i + 1] = 4;
            k--;
          }
        } else {
          if (i - 1 >= 0 && a[i - 1] == 4) {
            if (k % 2 == 1) {
              a[i] = 7;
            }
            k = 0;
          } else {
            a[i] = 7;
            k--;
          }
        }
      }
    }
  for ((i) = 0; (i) < (n); (i)++) cout << a[i];
  cout << endl;
  return 0;
}
