#include <bits/stdc++.h>
using namespace std;
long long mod_v(long long num) {
  if (num >= 0)
    return (num % 1000000007);
  else
    return (num % 1000000007 + 1000000007) % 1000000007;
}
long long bigmod(long long b, long long p, long long m) {
  long long res = 1 % m, x = b % m;
  while (p) {
    if (p & 1) res = (res * x) % m;
    x = (x * x) % m;
    p >>= 1;
  }
  return res;
}
int main() {
  int n, k, p, type;
  bool first = true;
  string str;
  scanf("%d %d", &n, &k);
  cin >> str;
  for (int i = 0; i < n - 1; i++) {
    if (k <= 0) break;
    if (str[i] == '4' && str[i + 1] == '7') {
      if (i % 2 == 0) {
        str[i] = str[i + 1] = '4';
      } else {
        str[i] = str[i + 1] = '7';
      }
      k--;
      if (i % 2 == 1) {
        if (i - 1 >= 0 && str[i - 1] == '4') {
          if (first) {
            first = false;
            p = i - 1;
            type = 1;
            break;
          }
        }
      } else {
        if (i + 1 < n && str[i + 1] == '7') {
          if (first) {
            first = false;
            p = i;
            type = 2;
            break;
          }
        }
      }
    }
  }
  if (k % 2 == 1 && !first) {
    if (type == 1) {
      str[p] = '4';
      str[p + 1] = '4';
      str[p + 2] = '7';
    } else {
      str[p] = '4';
      str[p + 1] = '7';
      str[p + 2] = '7';
    }
  }
  cout << str << "\n";
}
