#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
const int MAXM = 1000005;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
const int MOD = 1000000007;
const double FINF = 1e30;
int main() {
  int n, k;
  string s;
  scanf("%d%d", &n, &k);
  cin >> s;
  for (int i = 0; i < n - 1 && k > 0; ++i) {
    if (s[i] == '4' && s[i + 1] == '7') {
      if (i % 2 == 0)
        s[i + 1] = '4', k--;
      else {
        if (i != 0) {
          if (s[i - 1] == '4') {
            k = k % 2;
            if (k == 1) s[i] = '7';
            k = 0;
          } else {
            s[i] = '7';
            k--;
          }
        } else {
          s[i] = '7';
          k--;
        }
      }
    }
  }
  cout << s << endl;
}
