#include <bits/stdc++.h>
using namespace std;
int n, k;
int len;
char s[100010];
vector<int> v;
void end() {
  printf("%s\n", s);
  exit(0);
}
int main() {
  scanf("%d%d", &n, &k);
  gets(s);
  gets(s);
  len = strlen(s);
  for (int i = 0; i < len - 1; i++) {
    if (s[i] == '4' && s[i + 1] == '7') {
      v.push_back(i);
      i++;
    }
  }
  int cnt = 0;
  for (int i = 0; i < int(v.size()); i++) {
  loop:
    if (cnt >= k) {
      end();
    }
    if ((v[i] != 0) && (s[v[i] - 1] == '4')) {
      if ((v[i] % 2 == 1)) {
        if ((k - cnt) % 2 == 0) {
          end();
        } else {
          s[v[i]] = '7';
          end();
        }
      } else {
        s[v[i] + 1] = '4';
        cnt++;
        if ((v[i] + 2 < len) && (s[v[i] + 2] == '7')) {
          v[i]++;
          goto loop;
        }
      }
    } else if ((v[i] + 2 < len) && (s[v[i] + 2] == '7')) {
      if ((v[i] % 2 == 0)) {
        if ((k - cnt) % 2 == 0) {
          end();
        } else {
          s[v[i] + 1] = '4';
          end();
        }
      } else {
        s[v[i]] = '7';
        cnt++;
        if (v[i] > 0 && s[v[i] - 1] == '4') {
          v[i]--;
          goto loop;
        }
      }
    } else {
      if (v[i] % 2 == 1) {
        s[v[i]] = '7';
      } else {
        s[v[i] + 1] = '4';
      }
      cnt++;
    }
  }
  end();
  return 0;
}
