#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long int k;
  string s;
  cin >> n >> k;
  cin >> s;
  for (int i = 0; k > 0 and i < n - 1; i++) {
    if (i < n - 2 and i % 2 == 0 and s[i] == '4' and s[i + 1] == '4' and
        s[i + 2] == '7') {
      if (k % 2 == 1) s[i + 1] = '7';
      break;
    } else if (i < n - 2 and i % 2 == 0 and s[i] == '4' and s[i + 1] == '7' and
               s[i + 2] == '7') {
      if (k % 2 == 1) s[i + 1] = '4';
      break;
    } else {
      if (s[i] == '4' and s[i + 1] == '7') {
        if (i % 2 == 0)
          s[i + 1] = '4';
        else
          s[i] = '7';
        k--;
      }
    }
  }
  cout << s;
  return 0;
}
