#include <bits/stdc++.h>
inline int getint() {
  int x = 0, p = 1;
  char c = getchar();
  while (c <= 32) c = getchar();
  if (c == 45) p = -p, c = getchar();
  while (c > 32) x = x * 10 + c - 48, c = getchar();
  return x * p;
}
using namespace std;
const int N = 2e5 + 5;
list<pair<int, pair<int, int> > > hh;
int n, k;
char a[N], res[N];
vector<int> r[N];
bool isall() {
  for (int(i) = 0; (i) < (n - 1); (i)++)
    if (a[i] == a[i + 1]) return false;
  if (a[0] != a[n - 1]) return true;
  return false;
}
bool judge(int x) {
  return a[x] != a[(x - 1 + n) % n] && a[x] != a[(x + 1) % n];
}
int main() {
  n = getint();
  k = getint();
  scanf("%s", a);
  if (isall()) {
    if (k & 1)
      for (int(i) = 0; (i) < (n); (i)++) printf("%c", 'B' + 'W' - a[i]);
    else
      printf("%s", a);
    return 0;
  }
  int len = 0;
  for (int i = 0, j; i < n; i = j + 1) {
    j = i;
    if (!judge(i)) {
      res[i] = a[i];
      continue;
    }
    while (j < n - 1 && judge(j + 1)) ++j;
    hh.push_back(make_pair(j - i + 1, make_pair(i, j)));
    len = max(len, j - i + 1);
    for (int k = i; k <= j; k++) r[a[k]].push_back(k);
  }
  if (judge(0) && judge(n - 1)) {
    len = max(len, hh.back().first + hh.front().first);
    hh.front().second.first = hh.back().second.first;
    hh.front().first += hh.back().first;
    hh.pop_back();
  }
  int p = 0;
  while (p < k && hh.size()) {
    ++p;
    for (auto &ee : hh) {
      auto &e = ee.second;
      if (p & 1)
        res[e.first] = 'B' + 'W' - a[e.first];
      else
        res[e.first] = a[e.first];
      if (p & 1)
        res[e.second] = 'B' + 'W' - a[e.second];
      else
        res[e.second] = a[e.second];
      e.first++;
      if (e.first >= n) e.first = 0;
      e.second--;
      if (e.second < 0) e.second += n;
      ee.first -= 2;
    }
    list<pair<int, pair<int, int> > >::iterator it2 = hh.begin();
    ++it2;
    for (list<pair<int, pair<int, int> > >::iterator it = hh.begin();
         it != hh.end(); it = it2, it2++) {
      if (it->first <= 0) hh.erase(it);
    }
  }
  for (int(i) = 0; (i) < (n); (i)++)
    if (!res[i]) {
      if (k & 1)
        res[i] = 'B' + 'W' - a[i];
      else
        res[i] = a[i];
    }
  for (int(i) = 0; (i) < (n); (i)++) printf("%c", res[i]);
  return 0;
}
