#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.14159265358979323846264338328;
const long long mx64 = 9223372036854775807;
const int mx32 = 2147483647;
const short int mx16 = 32767;
const long long mod_1 = 1000000007;
const long long mod_2 = 998244353;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(25);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  set<char> st;
  for (int i = 0; i < n; i++) {
    st.insert(s[i]);
  }
  if (st.size() == 1) {
    for (int i = 0; i < n; i++) {
      cout << *st.begin();
    }
    return 0;
  }
  vector<bool> stab(3 * n, false);
  vector<bool> vst(3 * n, false);
  s += s;
  s += s;
  for (int i = n; i < 2 * n; i++) {
    if (!vst[i]) {
      vst[i] = true;
      int sz = 1;
      int l = i - 1;
      while (s[l] == s[i]) {
        sz++;
        vst[l--] = true;
      }
      int r = i + 1;
      while (s[r] == s[i]) {
        sz++;
        vst[r++] = true;
      }
      if (sz > 1) {
        for (int j = l + 1; j < r; j++) {
          stab[j] = true;
        }
      }
    }
  }
  vector<char> ans(n);
  vector<pair<int, char>> ds(3 * n, {0, '-'});
  for (int i = 0; i < n; i++) {
    if (stab[i] || stab[i + n] || stab[i + n + n]) {
      stab[i] = true;
      stab[i + n] = true;
      stab[i + n + n] = true;
    }
  }
  for (int i = 0; i < 2 * n;) {
    if (stab[i]) {
      int l = i;
      while (stab[l]) {
        l++;
      }
      int r = l;
      while (!stab[r]) {
        r++;
      }
      int rr = r;
      int ll = l - 1;
      r--;
      while (l <= r) {
        if (ds[i % n].first != 0) {
          break;
        }
        ds[(l % n)].first = l - ll;
        ds[(l % n) + n].first = l - ll;
        ds[(l % n) + n + n].first = l - ll;
        ds[(l % n)].second = s[ll];
        ds[(l % n) + n].second = s[ll];
        ds[(l % n) + n + n].second = s[ll];
        ds[(r % n)].first = rr - r;
        ds[(r % n) + n].first = rr - r;
        ds[(r % n) + n + n].first = rr - r;
        ds[(r % n)].second = s[rr];
        ds[(r % n) + n].second = s[rr];
        ds[(r % n) + n + n].second = s[rr];
        l++;
        r--;
      }
      i = rr;
    } else {
      i++;
    }
  }
  for (int i = n; i < 2 * n; i++) {
    if (stab[i]) {
      ans[i % n] = s[i];
    } else {
      if (ds[i].first <= k && ds[i].first != 0) {
        ans[i % n] = ds[i].second;
      } else {
        if (k % 2 == 1) {
          if (s[i] == 'W') {
            ans[i % n] = 'B';
          } else {
            ans[i % n] = 'W';
          }
        } else {
          ans[i % n] = s[i];
        }
      }
    }
    cout << ans[i % n];
  }
  return 0;
}
