#include <bits/stdc++.h>
const double PI = 3.1415926535897932384626433832795;
using namespace std;
long long mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(12);
  cout << fixed;
  string s;
  int n, k, stop, idx = -1;
  cin >> n >> k >> s;
  stop = n - 1;
  for (int i = 0; i < n - 2; ++i) {
    if (s.substr(i, 2) == "47" && idx == -1) {
      idx = i;
    }
    if (s.substr(i, 3) == "447" && i % 2 == 0) {
      stop = i + 1;
      if (idx == -1) idx = i + 1;
      break;
    }
    if (s.substr(i, 3) == "477" && i % 2 == 0) {
      stop = i + 1;
      if (idx == -1) idx = i;
      break;
    }
  }
  if (idx == -1 && s.substr(n - 2, 2) == "47") idx = n - 2;
  if (idx == -1) {
    cout << s << '\n';
    return 0;
  }
  while (k && idx != stop) {
    if (idx % 2)
      s[idx] = '7';
    else
      s[idx + 1] = '4';
    while (idx < n - 1 && s.substr(idx, 2) != "47") ++idx;
    --k;
  }
  if (k && idx < n - 1 && k % 2) {
    if (idx % 2)
      s[idx] = '7';
    else
      s[idx + 1] = '4';
  }
  cout << s << '\n';
  return 0;
}
