#include <bits/stdc++.h>
using namespace std;
string str;
const int kN = 1000 * 1000;
int d[kN];
int ind_circle_odd = INT_MAX, ind_circle_even = INT_MAX;
set<int> pos;
int main() {
  int n, k;
  cin >> n >> k;
  getline(cin, str);
  getline(cin, str);
  for (int i = 0; i < str.length(); ++i) d[i] = str[i] - '0';
  for (int i = n - 2; i >= 0; --i) {
    if (i % 2 == 0) {
      if (d[i] == 4 && d[i + 1] == 7 && d[i + 2] == 7) ind_circle_even = i;
      if (d[i] == 4 && d[i + 1] == 4 && d[i + 2] == 7) ind_circle_odd = i + 1;
    }
  }
  for (int i = 0; i < n - 1; ++i)
    if (d[i] == 4 && d[i + 1] == 7) pos.insert(i);
  for (int k_index = k; k_index > 0; --k_index) {
    if (pos.empty()) break;
    int index = *pos.begin();
    pos.erase(pos.begin());
    if (index == ind_circle_even) {
      if (k_index % 2 != 0) d[index + 1] = 4;
      break;
    }
    if (index == ind_circle_odd) {
      if (k_index % 2 != 0) d[index] = 7;
      break;
    }
    if (index % 2 != 0)
      d[index] = d[index + 1] = 7;
    else
      d[index] = d[index + 1] = 4;
  }
  for (int i = 0; i < n; ++i) cout << d[i];
  return 0;
}
