#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long rand(long long l, long long r) {
  uniform_int_distribution<long long> uid(l, r);
  return uid(rng);
}
int n, k;
inline int nxt(int idx) {
  if (idx == n - 1) return 0;
  return idx + 1;
}
inline int pr(int idx) {
  if (idx == 0) return n - 1;
  return idx - 1;
}
inline char inv(char ch) { return ((ch == 'B') ? 'W' : 'B'); }
const int N = 2e5 + 5;
bool mark[N];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  string s;
  cin >> s;
  bool alt = 1;
  for (int i = 0; i <= n - 1; i++) {
    if (s[pr(i)] == s[i]) {
      mark[i] = mark[pr(i)] = 1;
      alt = 0;
    }
  }
  if (alt) {
    if (k & 1) {
      for (int i = 0; i <= n - 1; i++) {
        cout << inv(s[i]);
      }
    } else {
      cout << s;
    }
    return 0;
  }
  for (int l = 0; l <= n - 1; l++) {
    if (!mark[l] && mark[pr(l)]) {
      int r = l;
      int d1 = 1, d2 = 1;
      while (!mark[nxt(r)]) {
        r = nxt(r);
        d2++;
      }
      for (int i = l; i != nxt(r); i = nxt(i)) {
        if (d1 < d2) {
          if (d1 <= k) {
            s[i] = s[pr(l)];
          } else {
            s[i] = ((k & 1) ? inv(s[i]) : s[i]);
          }
        } else {
          if (d2 <= k) {
            s[i] = s[nxt(r)];
          } else {
            s[i] = ((k & 1) ? inv(s[i]) : s[i]);
          }
        }
        d1++, d2--;
      }
    }
  }
  cout << s;
  return 0;
}
