#include <bits/stdc++.h>
using namespace std;
const int Mx = 2e5 + 10, inf = 1e9 + 1;
int n, k, top, sum[Mx];
char ch[Mx];
bool vis[Mx];
struct Blank {
  int l, r;
} B[Mx];
int main() {
  scanf("%d%d%s", &n, &k, ch);
  int it = 0;
  while (it <= n && !vis[it]) {
    int l = it, r = it;
    vis[it] = 1;
    for (; ch[((l + n - 1) % n)] == ch[l] && !vis[((l + n - 1) % n)];
         l = ((l + n - 1) % n), vis[l] = 1)
      ;
    for (; ch[((r + 1) % n)] == ch[r] && !vis[((r + 1) % n)];
         r = ((r + 1) % n), vis[r] = 1)
      ;
    if (l != r)
      vis[l] = vis[r] = 1, B[++top] = (Blank){l, r};
    else
      vis[l] = 0;
    it = r + 1;
  }
  for (int i = 0; i < n; i++) sum[i] = inf;
  for (int i = 1, r, l, it; i <= top; i++) {
    for (r = B[i].l, sum[r] = 0; ((r + 1) % n) != B[i].l && vis[((r + 1) % n)];
         r = ((r + 1) % n), sum[r] = 0)
      ;
    for (r = B[i].r, it = 0; !vis[((r + 1) % n)];
         r = ((r + 1) % n), it++, sum[r] = min(sum[r], it))
      ;
    for (l = B[i].l, it = 0; !vis[((l + n - 1) % n)];
         l = ((l + n - 1) % n), it++, sum[l] = min(sum[l], it))
      ;
  }
  for (int i = 0; i < n; i++) {
    int pos = min(sum[i], k);
    putchar(pos & 1 ? 'B' + 'W' - ch[i] : ch[i]);
  }
}
