#include <bits/stdc++.h>
using namespace std;
const int LOG = 20;
const int MAX = 2e5 + 5;
const int MOD = 1e9 + 7;
const long long INF = 1e9 + 5;
const long long lon = 1e18;
int n, k;
int lifespan[MAX], l[MAX], r[MAX];
char color[MAX], pcolor[MAX];
int prev(int p) { return (p - 1 + n) % n; }
int next(int p) { return (p + 1) % n; }
void precompute() {
  int cnt = 0;
  for (int i = 0; i <= n - 1; i++) {
    if (color[prev(i)] == color[i] || color[next(i)] == color[i]) {
      lifespan[i] = 0;
      cnt++;
    }
  }
  if (!cnt) return;
  if (lifespan[0] != 0) {
    for (int i = 1; i <= n; i++) {
      if (lifespan[n - i] == 0) {
        l[0] = i;
        break;
      }
    }
  }
  if (lifespan[n - 1] != 0) {
    for (int i = 1; i <= n; i++) {
      if (lifespan[i - 1] == 0) {
        r[n - 1] = i;
        break;
      }
    }
  }
  for (int i = 1; i <= n - 1; i++) {
    if (lifespan[i] != 0) l[i] = l[prev(i)] + 1;
  }
  for (int i = n - 2; i >= 0; i--) {
    if (lifespan[i] != 0) r[i] = r[next(i)] + 1;
  }
  for (int i = 0; i <= n - 1; i++) {
    if (l[i] <= r[i]) {
      lifespan[i] = l[i];
      pcolor[i] = color[(i - l[i] + n) % n];
    } else {
      lifespan[i] = r[i];
      pcolor[i] = color[(i + r[i]) % n];
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i <= n - 1; i++) cin >> color[i];
  fill(lifespan, lifespan + n, INF);
  precompute();
  for (int i = 0; i <= n - 1; i++) {
    if (k >= lifespan[i])
      cout << pcolor[i];
    else {
      if (k % 2 == 0)
        cout << color[i];
      else {
        if (color[i] == 'B')
          cout << 'W';
        else
          cout << 'B';
      }
    }
  }
}
