#include <bits/stdc++.h>
using namespace std;
const int maxn = 110000, maxm = 30000, inf = 1000000000;
char ch[maxn];
int main() {
  int n, m, i, len;
  while (cin >> n >> m) {
    scanf("%s", ch);
    len = strlen(ch);
    i = 0;
    for (; i < len && m > 0;) {
      if (i % 2 == 0 && ch[i] == '4' && ch[i + 1] == '4' && ch[i + 2] == '7') {
        m = m % 2;
        if (m == 0) break;
      }
      if (i % 2 == 0 && ch[i] == '4' && ch[i + 1] == '7' && ch[i + 2] == '7') {
        m = m % 2;
        if (m == 0) break;
      }
      if (ch[i] == '4' && ch[i + 1] == '7') {
        if (i % 2 == 1) {
          ch[i] += 3;
          if (i > 0 && ch[i - 1] == '4') {
            i -= 2;
          }
        } else
          ch[i + 1] -= 3;
        m--;
      }
      i++;
    }
    printf("%s\n", ch);
  }
}
