#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
vector<long long> nums;
void gener(long long x) {
  if (x > 90000000000) return;
  long long x1 = x * 10 + 4;
  if (x1 < 90000000000) {
    nums.push_back(x1);
    gener(x1);
  }
  x1 = x * 10 + 7;
  if (x1 < 90000000000) {
    nums.push_back(x1);
    gener(x1);
  }
}
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  for (long long i = 0; i < s.size() - 1; i++) {
    if (k == 0) break;
    if (i + 2 < s.size()) {
      if (s[i] == '4' && s[i + 1] == '4' && s[i + 2] == '7' && i % 2 == 0) {
        if (k % 2) s[i + 1] = '7';
        cout << s << endl;
        return 0;
      }
      if (s[i] == '4' && s[i + 1] == '7' && s[i + 2] == '7' && i % 2 == 0) {
        if (k % 2) s[i + 1] = '4';
        cout << s << endl;
        return 0;
      }
      if (s[i] == '4' && s[i + 1] == '7') {
        if (i % 2)
          s[i] = s[i + 1] = '7';
        else
          s[i] = s[i + 1] = '4';
        --k;
      }
    }
    if (s[i] == '4' && s[i + 1] == '7') {
      if (i % 2)
        s[i] = s[i + 1] = '7';
      else
        s[i] = s[i + 1] = '4';
      --k;
    }
  }
  cout << s << endl;
}
