#include <bits/stdc++.h>
using namespace std;
int next(int p, int n) { return p == n - 1 ? 0 : p + 1; }
int prev(int p, int n) { return p == 0 ? n - 1 : p - 1; }
int flip(char c) { return c == 'B' ? 'W' : 'B'; }
int main() {
  int n, K;
  char s[200005];
  scanf("%d%d%s", &n, &K, s);
  int start = -1;
  for (int i = 0; i < n && start == -1; ++i)
    if (s[i] == s[prev(i, n)]) start = i;
  if (start == -1) {
    for (int i = 0; i < n; ++i) s[i] = K % 2 ? flip(s[i]) : s[i];
    printf("%s\n", s);
    return 0;
  }
  vector<int> dist(n, 0), color(n, 0);
  int curr_dist = 0, curr_color = s[start];
  for (int i = start, j = 0; j < n; i = next(i, n), ++j, ++curr_dist)
    if (s[i] == s[prev(i, n)] || s[i] == s[next(i, n)])
      curr_dist = 0, curr_color = s[i], color[i] = s[i];
    else
      dist[i] = curr_dist, color[i] = curr_color;
  curr_dist = 0, curr_color = s[start];
  for (int i = prev(start, n), j = 0; j < n; i = prev(i, n), ++j, ++curr_dist)
    if (s[i] == s[prev(i, n)] || s[i] == s[next(i, n)])
      curr_dist = 0, curr_color = s[i];
    else if (dist[i] > curr_dist)
      dist[i] = curr_dist, color[i] = curr_color;
  for (int i = 0; i < n; ++i)
    s[i] = dist[i] <= K ? color[i] : K % 2 ? flip(s[i]) : s[i];
  printf("%s\n", s);
}
