#include <bits/stdc++.h>
using namespace std;
int vis[200005];
char clr[200005];
int main() {
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  queue<pair<int, int> > q;
  for (int i = 0; i < n; i++) {
    if (s[i] == s[(i - 1 + n) % n] || s[i] == s[(i + 1) % n]) {
      q.push(make_pair(i, 0));
      vis[i] = 1;
      clr[i] = s[i];
    }
  }
  while (!q.empty()) {
    pair<int, int> p = q.front();
    q.pop();
    if (p.second >= k) break;
    int i = p.first;
    if (vis[(i + 1) % n] == 0) {
      vis[(i + 1) % n] = 1;
      clr[(i + 1) % n] = clr[p.first];
      q.push(make_pair((i + 1) % n, p.second + 1));
    }
    if (vis[(i - 1 + n) % n] == 0) {
      vis[(i - 1 + n) % n] = 1;
      clr[(i - 1 + n) % n] = clr[p.first];
      q.push(make_pair((i - 1 + n) % n, p.second + 1));
    }
  }
  string ans = "";
  for (int i = 0; i < n; i++) {
    if (vis[i])
      ans += clr[i];
    else if (k % 2) {
      if (s[i] == 'W')
        ans += 'B';
      else
        ans += 'W';
    } else
      ans += s[i];
  }
  cout << ans << "\n";
  return 0;
}
