#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const int MOD = 1e9 + 7;
long long cnt[N];
char ans[N];
queue<long long> qu;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  s = s.back() + s;
  s.push_back(s[1]);
  fill(cnt, cnt + N, INT_MAX);
  for (long long i = 1; i <= n; ++i) {
    if (s[i] == s[i - 1] || s[i] == s[i + 1]) {
      cnt[i] = 0;
      ans[i] = s[i];
      qu.push(i);
    }
  }
  ans[n + 1] = ans[1];
  cnt[n + 1] = cnt[1];
  ans[0] = ans[n];
  cnt[0] = cnt[n];
  while (!qu.empty()) {
    long long id = qu.front();
    qu.pop();
    ans[n + 1] = ans[1];
    cnt[n + 1] = cnt[1];
    ans[0] = ans[n];
    cnt[0] = cnt[n];
    if (ans[id] == ans[id - 1]) {
      if (cnt[id + 1] == INT_MAX) {
        cnt[id + 1] = max(cnt[id], cnt[id - 1]) + 1;
        ans[id + 1] = ans[id];
        if (id != n)
          qu.push(id + 1);
        else {
          ans[1] = ans[n + 1];
          cnt[1] = cnt[n + 1];
          qu.push(1);
        }
      }
    }
    if (ans[id] == ans[id + 1]) {
      if (cnt[id - 1] == INT_MAX) {
        cnt[id - 1] = max(cnt[id], cnt[id + 1]) + 1;
        ans[id - 1] = ans[id];
        if (id != 1)
          qu.push(id - 1);
        else {
          ans[n] = ans[0];
          cnt[n] = cnt[0];
          qu.push(n);
        }
      }
    }
  }
  for (long long i = 1; i <= n; ++i) {
    if (cnt[i] < k) {
      cout << ans[i];
    } else {
      if (k % 2 == 0)
        cout << s[i];
      else {
        if (s[i] == 'W')
          cout << 'B';
        else
          cout << 'W';
      }
    }
  }
  return 0;
}
