#include <bits/stdc++.h>
using namespace std;
int leftDistance[300003];
int rightDistance[300003];
char leftType[300003];
char rightType[300003];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  string s;
  int n, k;
  cin >> n >> k;
  cin >> s;
  s += s;
  int currentLeft = -2000000000;
  for (int i = 0; i < s.size(); ++i) {
    int next = (i + 1) % (int)(s.size());
    int prev = (i - 1) % (int)(s.size());
    if (prev < 0) prev += s.size();
    if (s[i] == s[next] or s[i] == s[prev]) {
      currentLeft = i;
    }
    leftDistance[i % n] = i - currentLeft;
    if (currentLeft >= 0) leftType[i % n] = s[currentLeft];
  }
  int currentRight = 2000000000;
  for (int i = s.size() - 1; i >= 0; --i) {
    int next = (i + 1) % (int)(s.size());
    int prev = (i - 1) % (int)(s.size());
    if (prev < 0) prev += s.size();
    if (s[i] == s[next] or s[i] == s[prev]) {
      currentRight = i;
    }
    rightDistance[i % n] = currentRight - i;
    if (currentRight < s.size()) rightType[i % n] = s[currentRight];
  }
  for (int i = 0; i < n; ++i) {
    if (leftDistance[i] <= k and rightDistance[i] <= k) {
      if (leftDistance[i] <= rightDistance[i]) {
        cout << leftType[i];
      } else {
        cout << rightType[i];
      }
      continue;
    }
    if (leftDistance[i] <= k) {
      cout << leftType[i];
      continue;
    }
    if (rightDistance[i] <= k) {
      cout << rightType[i];
      continue;
    }
    if (k % 2) {
      if (s[i] == 'W')
        cout << 'B';
      else
        cout << 'W';
    } else {
      if (s[i] == 'W')
        cout << 'W';
      else
        cout << 'B';
    }
  }
  return 0;
}
