#include <bits/stdc++.h>
using namespace std;
const int N = 200002;
char c[N * 2];
int n, k;
char doi(int c) {
  if (c == 'W') return 'B';
  return 'W';
}
void prg(int l, int r) {
  int h = r - l + 1;
  int tt = h % 2;
  h /= 2;
  int L = l + min(h, k);
  int R = r - min(h, k);
  char x = doi(c[l]), y = doi(c[r]);
  for (int i = l; i < L; i++) c[i] = x;
  for (int i = r; i > R; i--) c[i] = y;
  if (k > h && tt)
    c[l + h] = x;
  else
    for (int i = L; i <= R; i++) c[i] = doi(c[i - 1]);
  for (int i = l; i <= r; i++) c[i % n] = c[i];
}
int main() {
  ios_base::sync_with_stdio();
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> c[i];
  for (int i = n; i < n * 2; i++) c[i] = c[i - n];
  bool tt = 0;
  for (int i = 1; i <= n; i++)
    if (c[i] == c[i - 1]) {
      tt = 1;
      break;
    }
  if (!tt) {
    if (k % 2)
      for (int i = 1; i <= n; i++) cout << c[i];
    else
      for (int i = 0; i < n; i++) cout << c[i];
    return 0;
  }
  int vt, l = -1;
  for (int i = 1; i < n * 2; i++)
    if (c[i] == c[i - 1]) {
      vt = i - 1;
      break;
    }
  for (int i = vt; i < n + vt; i++) {
    if (c[i] != c[i - 1] && c[i] != c[i + 1]) {
      if (l < 0) l = i;
      if (l >= 0 && c[i + 1] == c[(i + 2) % n]) {
        prg(l, i);
        l = -1;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << c[i];
  return 0;
}
