#include <bits/stdc++.h>
using namespace std;
void Emsawy() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
const double PI = acos(-1.0);
const double eps = 1e-10;
const long long mod = 1e9 + 7, oo = 1e9;
int dx[]{1, -1, 0, 0, 1, -1, 1, -1};
int dy[]{0, 0, 1, -1, 1, -1, -1, 1};
int n, m, a, b, T;
double x;
const int N = 100000 + 5;
char g[N];
int main() {
  Emsawy();
  while (cin >> n >> m) {
    for (int i = 1; i <= n; i++) cin >> g[i];
    int id = -1;
    for (int i = 1; i + 1 <= n; i++) {
      if (m <= 0) break;
      if (g[i] == '4' && g[i + 1] == '7') {
        if (i % 2) {
          g[i + 1] = '4';
          i--;
        } else
          g[i] = '7';
        m--;
        continue;
      }
      if (g[i] == '4' && g[i + 1] == '4' && i % 2) {
        if (i + 2 <= n && g[i + 2] == '7') {
          id = i;
          break;
        }
      }
    }
    if (m > 0 && id != -1) {
      if (m % 2) {
        if ((id + 1) % 2)
          g[id + 2] = '4';
        else
          g[id + 1] = '7';
      }
    }
    for (int i = 1; i <= n; i++) cout << g[i];
    cout << endl;
  }
  return 0;
}
