#include <bits/stdc++.h>
using namespace std;
int n, k;
char s[200100];
int a[200100], L[200100], R[200100];
vector<int> pos;
int main() {
  cin >> n >> k;
  cin >> s;
  for (int i = 0; i < n; i++) {
    int l = (i - n) % n + n - 1;
    int r = (i + 1) % n;
    if (s[i] == s[l] || s[i] == s[r]) {
      pos.push_back(i);
      a[i] = 1;
    }
  }
  int len = pos.size();
  if (!len) {
    if (k % 2) {
      for (int i = 0; i < n; i++) {
        s[i] = (s[i] == 'W') ? 'B' : 'W';
      }
    }
    cout << s << endl;
    return 0;
  }
  int las = pos[len - 1];
  for (int i = 0; i < n; i++) {
    if (a[i])
      las = i;
    else
      L[i] = las;
  }
  las = pos[0];
  for (int i = n - 1; i >= 0; i--) {
    if (a[i])
      las = i;
    else
      R[i] = las;
  }
  for (int i = 0; i < n; i++) {
    if (!a[i]) {
      int ld = (i - L[i] + n) % n;
      int rd = (R[i] - i + n) % n;
      if (min(ld, rd) <= k) {
        s[i] = (ld < rd) ? s[L[i]] : s[R[i]];
      } else {
        if (k % 2) s[i] = (s[i] == 'W') ? 'B' : 'W';
      }
    }
  }
  cout << s << endl;
  return 0;
}
