#include <bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wmissing-declarations"
inline int safe_mul(const int x, const int y)
    __attribute__((warn_unused_result));
int main() {
  cout << fixed << setprecision(20);
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  vector<bool> fix(n, false);
  for (int i = 0; i < n; ++i) {
    int ni = i == n - 1 ? 0 : i + 1;
    if (s[i] == s[ni]) fix[i] = fix[ni] = true;
  }
  vector<int> lf(n, k + 1);
  vector<char> lv(n);
  int pr = k + 1;
  char cp = 0;
  for (int step = 0; step < 2; ++step)
    for (int i = 0; i < n; ++i) {
      ++pr;
      if (fix[i]) {
        pr = 0;
        cp = s[i];
      }
      lf[i] = pr;
      lv[i] = cp;
    }
  vector<int> ri(n, k + 1);
  vector<char> rv(n);
  pr = k + 1;
  cp = 0;
  for (int step = 0; step < 2; ++step)
    for (int i = n - 1; i >= 0; --i) {
      ++pr;
      if (fix[i]) {
        pr = 0;
        cp = s[i];
      }
      ri[i] = pr;
      rv[i] = cp;
    }
  for (int i = 0; i < n; ++i)
    if (min(lf[i], ri[i]) <= k) {
      if (lf[i] < ri[i])
        s[i] = lv[i];
      else
        s[i] = rv[i];
    } else {
      if (k % 2) {
        s[i] = (s[i] == 'W') ? 'B' : 'W';
      }
    }
  cout << s << endl;
}
