#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
bool fixed_pos[N];
int left_dis[N], right_dis[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  int n, k;
  string s;
  cin >> n >> k >> s;
  for (int i = 0; i < n; ++i) {
    if (s[i] == s[(i - 1 + n) % n] || s[i] == s[(i + 1) % n])
      fixed_pos[i] = true, left_dis[i] = right_dis[i] = INT_MAX;
  }
  for (int i = 0; i < n; ++i) {
    if (!fixed_pos[i]) continue;
    left_dis[i] = right_dis[i] = 0;
    for (int j = (i + 1) % n; !fixed_pos[j]; j = (j + 1) % n)
      left_dis[j] = left_dis[(j - 1 + n) % n] + 1;
    for (int j = (i + n - 1) % n; !fixed_pos[j]; j = (j + n - 1) % n)
      right_dis[j] = right_dis[(j + 1) % n] + 1;
  }
  for (int i = 0; i < n; ++i) {
    if (min(left_dis[i], right_dis[i]) > k) {
      bool cur_char_is_w = (s[i] == 'W') ^ (k & 1);
      cout << (cur_char_is_w ? 'W' : 'B');
    } else {
      int pos = (i - left_dis[i] + n) % n;
      if (left_dis[i] > right_dis[i]) pos = (i + right_dis[i]) % n;
      cout << s[pos];
    }
  }
  return 0;
}
