#include <bits/stdc++.h>
#pragma hdrstop
#pragma argsused
using namespace std;
int main(int argc, char* argv[]) {
  string s;
  int n, k, p;
  cin >> n >> k >> s;
  p = s.find("47", 0);
  while (p >= 0 && k) {
    if (p >= 0 && p + 2 <= n && s[p + 2] == '7' && p % 2 == 0) {
      if (k % 2 == 0)
        s[p + 2] = '7';
      else
        s[p + 1] = '4';
      break;
    }
    if (p % 2)
      s[p] = '7';
    else
      s[p + 1] = '4';
    p = s.find("47", max(p - 1, 0));
    k--;
  }
  cout << s;
  return 0;
}
