#include <bits/stdc++.h>
using namespace std;
long long int pw(long long int a, long long int p,
                 long long int m = 1000000007) {
  if (p == 1) return a;
  long long int t = pw(a, p / 2);
  t = (m + (t * t) % m) % m;
  if (p % 2 != 0) t *= a;
  return (t + m) % m;
}
vector<long long int> uniq(vector<long long int> arr) {
  vector<long long int> brr;
  sort((arr).begin(), (arr).end());
  brr.push_back(arr[0]);
  for (auto i : arr)
    if (brr.back() != i) brr.push_back(i);
  return brr;
}
void solve() {
  long long int n, k;
  cin >> n >> k;
  string a;
  cin >> a;
  for (long long int i = 0; i < (a.size() - 1); i++) {
    if (k == 0) {
      cout << a << endl;
      return;
    }
    if (i % 2 == 0) {
      if ((i < a.size() - 2) &&
          (a[i] == '4' && a[i + 1] == '7' && a[i + 2] == '7')) {
        if (k % 2 == 1) a[i + 1] = '4';
        cout << a << endl;
        return;
      }
      if ((i < a.size() - 2) &&
          (a[i] == '4' && a[i + 1] == '4' && a[i + 2] == '7')) {
        if (k % 2 == 1) a[i + 1] = '7';
        cout << a << endl;
        return;
      }
      if (a[i] == '4' && a[i + 1] == '7') {
        a[i + 1] = '4';
        k--;
      }
    } else {
      if (a[i] == '4' && a[i + 1] == '7') {
        a[i] = '7';
        k--;
      }
    }
  }
  cout << a << endl;
  return;
}
int main() {
  ios::sync_with_stdio(0);
  long long int t = 1;
  for (long long int i = 0; i < (t); i++) solve();
}
