#include <bits/stdc++.h>
using namespace std;
const int DIM = 2e5 + 7;
bool ok[DIM];
int st[DIM];
int dr[DIM];
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int nr = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == s[(i - 1 + n) % n] || s[i] == s[(i + 1) % n]) {
      nr++;
      ok[i] = true;
    }
  if (nr == 0) {
    if (k & 1)
      for (int i = 0; i < n; i++)
        if (s[i] == 'B')
          s[i] = 'W';
        else
          s[i] = 'B';
    cout << s << '\n';
    return 0;
  }
  int pos = n - 1;
  while (ok[pos] == false) pos--;
  for (int i = 0; i < n; i++)
    if (ok[i] == true)
      pos = i;
    else
      st[i] = pos;
  pos = 0;
  while (ok[pos] == false) pos++;
  for (int i = n - 1; i >= 0; i--)
    if (ok[i] == true)
      pos = i;
    else
      dr[i] = pos;
  string res = s;
  for (int i = 0; i < n; i++)
    if (ok[i] == false) {
      int l = (i - st[i] + n) % n;
      int r = (dr[i] - i + n) % n;
      if (l > k && r > k) {
        if (k & 1) {
          if (s[i] == 'B')
            res[i] = 'W';
          else
            res[i] = 'B';
        }
      } else if (l < r)
        res[i] = s[st[i]];
      else
        res[i] = s[dr[i]];
    }
  cout << res;
}
