#include <bits/stdc++.h>
using namespace std;
bool lucky(long long int a) {
  while (a) {
    if (a % 10 != 4 && a % 10 != 7) return false;
    a /= 10;
  }
  return true;
}
vector<long long int> gen() {
  vector<long long int> res;
  for (int k = 1; k < 11; k++) {
    for (int i = 0; i < (1 << k); i++) {
      long long int a = 0;
      for (int j = 0; j < k; j++) {
        a *= 10;
        if (i & (1 << j))
          a += 4;
        else
          a += 7;
      }
      res.push_back(a);
    }
  }
  sort(res.begin(), res.end());
  return res;
}
int main() {
  string str;
  int n, k;
  cin >> n >> k >> str;
  int x = -1;
  for (int i = 2; i < str.length(); i += 2) {
    if (str[i - 2] == '4' && str[i - 1] == '4' && str[i] == '7') {
      x = i - 2;
      break;
    }
    if (str[i - 2] == '4' && str[i - 1] == '7' & str[i] == '7') {
      x = i - 2;
      break;
    }
  }
  if (x == -1) {
    x = 1;
    while (k != 0 && x != str.length()) {
      if (str[x - 1] == '4' && str[x] == '7') {
        if (x % 2 != 0)
          str[x] = '4';
        else
          str[x - 1] = '7';
        k--;
      }
      x++;
    }
  } else {
    int s = 1;
    while (k != 0 && s < x) {
      if (str[s - 1] == '4' && str[s] == '7') {
        if (s % 2 != 0)
          str[s] = '4';
        else {
          str[s - 1] = '7';
          if (s != 1) s--;
        }
        k--;
      }
      s++;
    }
    if (k % 2 == 1) str[x + 1] = 11 + '0' - str[x + 1] + '0';
  }
  cout << str;
}
