#include <bits/stdc++.h>
using namespace std;
bool compare(string &s1, string &s2) { return s1.size() < s2.size(); }
bool sortmahstyle(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.first < b.first) return true;
  return false;
}
void solve() {
  long long int n, op;
  cin >> n >> op;
  string s;
  cin >> s;
  for (int i = 0; i < n - 2 && op > 0; i++) {
    if (s[i] != '4' && s[i + 1] == '4' && s[i + 2] == '7') {
      if (i % 2)
        s[i + 2] = '4', op--;
      else
        s[i + 1] = '7', op--;
    } else if (s[i] == '4' && s[i + 1] == '7' && s[i + 2] != '7') {
      if (i % 2 == 0)
        s[i + 1] = '4', op--;
      else
        s[i] = '7', op--;
    } else if (s[i] == '4' && s[i + 1] == '7' && s[i + 2] == '7') {
      if (i % 2 == 0) {
        if (op % 2) {
          s[i + 1] = '4';
          break;
        } else {
          break;
        }
      } else
        s[i] = '7', op--;
    } else if (s[i] == '4' && s[i + 1] == '4' && s[i + 2] == '7') {
      if (i % 2 == 0) {
        if (op % 2) {
          s[i + 1] = '7';
          break;
        } else {
          break;
        }
      } else
        s[i + 2] = '4', op--;
    }
  }
  cout << s << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  while (t-- > 0) solve();
  return 0;
}
