#include <bits/stdc++.h>
using namespace std;
const int MAX = (int)1e9;
const long long LMAX = (long long)1e15;
void fasto() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void custom() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "2", stdout);
}
void need() { fasto(); }
long long power(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b % 2) ans *= a;
    a *= a;
    b /= 2;
  }
  return ans;
}
vector<long long> factors(long long x) {
  vector<long long> v;
  for (long long i = 1; i * i <= x; i++) {
    if (x % i == 0) {
      v.push_back(i);
      if (x / i != i) v.push_back(x / i);
    }
  }
  sort(v.begin(), v.end());
  return v;
}
int main() {
  need();
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  s += '0';
  char prev = '0';
  long long curr = 0;
  while (k > 0 && curr < n) {
    if (s[curr] == '4' && s[curr + 1] == '7') {
      if (curr % 2 == 0) {
        s[curr + 1] = '4';
        k--;
      } else {
        if (prev == '4') {
          k %= 2;
          if (k) {
            s[curr] = '7';
            k--;
          }
        } else {
          s[curr] = '7';
          k--;
        }
      }
    }
    prev = s[curr];
    curr++;
  }
  s.pop_back();
  cout << s;
  return 0;
}
