#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const long long INF64 = (long long)1e18;
#pragma comment(linker, "/STACK:16777216")
#pragma warning(disable : 4786)
int Set(int N, int pos) { return N = N | (1 << pos); }
int Reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
double dis(int x1, int y1, int x2, int y2) { return hypot(x1 - x2, y1 - y2); }
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
long long LCM(long long a, long long b) { return (a / GCD(a, b)) * b; }
int ans, sum, t, n, k, m;
string s;
int dx[] = {0, 1, -1, 0, 0};
int dy[] = {0, 0, 0, 1, -1};
int main() {
  cin >> n >> k;
  cin >> s;
  int tag = 0;
  for (int i = 0; i <= n - 2; i++) {
    if (!k) break;
    if (s[i] == '4' && s[i + 1] == '7') {
      k--;
      if (!tag) {
        s[i] = '4';
        s[i + 1] = '4';
      } else {
        s[i] = '7';
        s[i + 1] = '7';
      }
      if (tag) {
        if (s[i - 1] == '4') {
          if (k % 2 == 1) s[i] = '4';
          break;
        }
      }
    }
    tag ^= 1;
  }
  cout << s << "\n";
  return 0;
}
