#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
int n, k;
int clo[N];
string s;
bool block[N];
int dist(int a, int b) {
  if (a > b) swap(a, b);
  if (a == -1 || b == n) return n;
  return min(b - a, n - (b - a));
}
char neg(char a) {
  if (a == 'W')
    return 'B';
  else
    return 'W';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  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]) {
      block[i] = 1;
    }
  }
  int cur = -1, l = n, r = -1;
  for (int i = 0; i < n; ++i) {
    clo[i] = n;
    if (block[i]) {
      l = min(l, i);
      r = max(r, i);
    }
  }
  for (int i = 0; i < n; ++i) {
    if (block[i]) {
      cur = i;
    }
    clo[i] = min(clo[i], dist(i, cur));
  }
  cur = -1;
  for (int i = n - 1; i >= 0; --i) {
    if (block[i]) {
      cur = i;
    }
    clo[i] = min(clo[i], dist(i, cur));
  }
  for (int i = 0; i < n; ++i) {
    clo[i] = min(clo[i], dist(i, l));
    clo[i] = min(clo[i], dist(i, r));
  }
  for (int i = 0; i < n; ++i) {
    if (clo[i] <= k) {
      cout << ((clo[i] % 2 == 0) ? s[i] : neg(s[i]));
    } else {
      cout << ((k % 2 == 0) ? s[i] : neg(s[i]));
    }
  }
}
