#include <bits/stdc++.h>
using namespace std;
int n;
int k;
char c[200001];
int d[200001];
char f[200001];
inline char ck(char c, int k) { return (c == 'W') ^ (k & 1 > 0) ? 'W' : 'B'; }
int main() {
  scanf("%d %d", &n, &k);
  scanf("%s", c);
  int ii = 0;
  while (ii < n && c[ii] != c[(ii + 1)] % n && c[ii] != c[(ii - 1 + n) % n])
    ii++;
  if (ii == n) {
    for (int i = 0; i < n; i++) printf("%c", ck(c[i], k));
    return 0;
  }
  int dis;
  char fin;
  for (int i = ii, j = 0; j == 0 || i != ii; i = (i + 1) % n, j = 1) {
    if (c[i] == c[(i + 1) % n] || c[i] == c[(i - 1 + n) % n]) {
      d[i] = 0;
      f[i] = c[i];
      dis = 0;
      fin = c[i];
    } else {
      d[i] = ++dis;
      f[i] = fin;
    }
  }
  for (int i = ii, j = 0; j == 0 || i != ii; i = (i + n - 1) % n, j = 1) {
    if (c[i] == c[(i + 1) % n] || c[i] == c[(i - 1 + n) % n]) {
      d[i] = 0;
      f[i] = c[i];
      dis = 0;
      fin = c[i];
    } else if (d[i] > ++dis) {
      d[i] = dis;
      f[i] = fin;
    }
  }
  for (int i = 0; i < n; i++)
    if (k <= d[i])
      printf("%c", ck(c[i], k));
    else
      printf("%c", f[i]);
  return 0;
}
