#include <bits/stdc++.h>
const int mod = 1000000007;
const int inf = 1000000009;
const long long INF = 1000000000000000009;
const long long big = 1000000000000000;
const long double eps = 0.0000000001;
using namespace std;
int T[200005], K[200005], C[200005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    if (c == 'W')
      T[i] = 2;
    else
      T[i] = 1;
  }
  for (int i = 0; i < n; i++) {
    C[i] = -1;
    int x = (i - 1 + n) % n, y = (i + 1) % n;
    if (T[i] == T[x] || T[i] == T[y]) K[i] = T[i], C[i] = 0;
  }
  queue<int> Q;
  for (int i = 0; i < n; i++)
    if (C[i] == 0) Q.push(i);
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    int x = (u - 1 + n) % n, y = (u + 1) % n;
    if (C[x] == -1) {
      C[x] = C[u] + 1;
      K[x] = K[u];
      Q.push(x);
    }
    if (C[y] == -1) {
      C[y] = C[u] + 1;
      K[y] = K[u];
      Q.push(y);
    }
  }
  for (int i = 0; i < n; i++) {
    if (C[i] != -1 && C[i] <= k) {
      if (K[i] == 1)
        cout << "B";
      else
        cout << "W";
    } else {
      if (T[i] == 1) {
        if (k % 2 == 1)
          cout << "W";
        else
          cout << "B";
      } else {
        if (k % 2 == 1)
          cout << "B";
        else
          cout << "W";
      }
    }
  }
  return 0;
}
