#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
long long k;
char arr[maxn];
int fix[maxn], n;
set<pair<int, int>> s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  for (int i = 0; i < maxn; i++) fix[i] = maxn;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    int pre = (i - 1 + n) % n;
    int nxt = (i + 1) % n;
    if (arr[i] == arr[pre] || arr[i] == arr[nxt]) {
      fix[i] = 0;
      s.insert({0, i});
    }
  }
  if (s.empty()) {
    if (k % 2 == 0) {
      for (int i = 0; i < n; i++) cout << arr[i];
    } else {
      for (int i = 0; i < n; i++) cout << (arr[i] == 'B' ? 'W' : 'B');
    }
    return 0;
  }
  while (!s.empty()) {
    pair<int, int> cur = *s.begin();
    s.erase(cur);
    int pre = (cur.second - 1 + n) % n;
    int nxt = (cur.second + 1) % n;
    if (fix[pre] > (cur.first + 1)) {
      fix[pre] = cur.first + 1;
      s.insert({fix[pre], pre});
    }
    if (fix[nxt] > (cur.first + 1)) {
      fix[nxt] = cur.first + 1;
      s.insert({fix[nxt], nxt});
    }
  }
  for (int i = 0; i < n; i++) {
    long long v = min(k, (long long)fix[i]);
    if (v % 2 == 0)
      cout << arr[i];
    else
      cout << (arr[i] == 'B' ? 'W' : 'B');
  }
  return 0;
}
