#include <bits/stdc++.h>
using namespace std;
int n, k, a[3 * 200005], b[3 * 200005], cnt, st;
vector<pair<int, int>> p;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    char x;
    scanf(" %c", &x);
    a[i + n] = a[i + n + n] = a[i] = (x == 'B');
  }
  for (int i = 2; i <= n + n + n - 1; i++) {
    b[i] = (a[i - 1] == a[i + 1]);
    cnt += b[i];
  }
  if (cnt == n + n + n - 2) {
    k = !k;
    for (int i = 1; i <= n; i++) printf("%c", ((a[i] + k) % 2 ? 'B' : 'W'));
    cout << endl;
    return 0;
  }
  st = 2;
  for (int i = 2; i <= n + n + n - 1; i++) {
    if (b[i] == 0) {
      st = i + 1;
      continue;
    }
    if (i == n + n + n - 1 || b[i + 1] == 0) {
      p.push_back(make_pair(st, i));
      st = i + 1;
    }
  }
  for (int i = 0; i < p.size(); i++) {
    for (int j = p[i].first;
         j < p[i].first + k && j <= (p[i].second + p[i].first + 1) / 2; j++)
      a[j] = a[p[i].first - 1];
    for (int j = p[i].second;
         j > p[i].second - k && j >= (p[i].second + p[i].first + 1) / 2; j--)
      a[j] = a[p[i].second + 1];
    for (int j = p[i].first + k; j <= p[i].second - k; j++) a[j] ^= k % 2;
  }
  for (int i = n + 1; i <= n + n; i++) printf("%c", (a[i] ? 'B' : 'W'));
  cout << endl;
  return 0;
}
