#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
int main() {
  long long int t, n, m, q, i, j, k, x, y, z;
  string s;
  x = -1;
  cin >> n >> k;
  cin >> s;
  v.assign(n, -1);
  for (i = 0; i < n; i++) {
    if (s[i] == s[(i + 1) % n]) {
      v[i] = 0;
      x = i;
    } else if (s[i] == s[(i - 1 + n) % n]) {
      v[i] = 0;
      x = i;
    }
  }
  if (x == -1) {
    if (k & 1) {
      for (i = 0; i < n; i++) {
        if (s[i] == 'W')
          cout << 'B';
        else
          cout << 'W';
      }
    } else {
      cout << s << "\n";
    }
  } else {
    y = x;
    for (i = 0; i < n; i++) {
      if (v[x] != 0) {
        v[x] = (v[(x - 1 + n) % n]) + 1;
      }
      x++;
      x %= n;
    }
    x = y;
    for (i = 0; i < n; i++) {
      if (v[x] != 0) {
        v[x] = min(v[x], v[(x + 1) % n] + 1);
      }
      x--;
      if (x < 0) x = n - 1;
    }
    for (i = 0; i < n; i++) {
      x = min(k, v[i]);
      if (x & 1) {
        if (s[i] == 'W')
          cout << "B";
        else
          cout << "W";
      } else {
        cout << s[i];
      }
    }
    cout << "\n";
  }
}
