#include <bits/stdc++.h>
using namespace std;
void solve();
void stupid_solve();
void check();
long long n, k;
string s;
void get_test() {
  n = rand() % (2 * 10000), k = 10;
  s.clear();
  s.resize(n);
  for (long long i = 0; i < n - 1; i += 2) {
    s[i] = 'B';
    s[i + 1] = 'W';
  }
  s[n - 1] = 'B';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed << setprecision(20);
  long long tt = 1;
  while (tt--) {
    solve();
  }
  return 0;
}
const long long N = (long long)(2 * 1e5 + 10);
long long used[N];
pair<long long, long long> d[N];
long long ans[N];
inline long long left(long long x) {
  if (x - 1 < 0) return n - 1;
  return x - 1;
}
inline long long right(long long x) {
  if (x + 1 == n) return 0;
  return x + 1;
}
void solve() {
  cin >> n >> k;
  cin >> s;
  for (auto i = 0; i < n; ++i) {
    long long l = left(i), r = right(i);
    if (s[l] == s[i]) {
      used[l] = used[i] = (s[i] == 'B' ? 1 : 2);
    }
    if (s[r] == s[i]) {
      used[r] = used[i] = (s[i] == 'B' ? 1 : 2);
    }
  }
  queue<pair<long long, long long> > q;
  for (auto i = 0; i < n; ++i) {
    if (used[i] == 1) {
      d[i].first = 0;
      d[i].second = 1;
      q.push({i, 1});
    } else if (used[i] == 2) {
      d[i].first = 0;
      d[i].second = 2;
      q.push({i, 2});
    } else {
      d[i].first = 2e18;
    }
  }
  while ((long long)(q.size())) {
    pair<long long, long long> x = q.front();
    q.pop();
    long long l = left(x.first), r = right(x.first);
    if (!used[l] && d[x.first].first + 1 < d[l].first) {
      d[l].first = d[x.first].first + 1;
      d[l].second = x.second;
      q.push({l, x.second});
    }
    if (!used[r] && d[x.first].first + 1 < d[r].first) {
      d[r].first = d[x.first].first + 1;
      d[r].second = x.second;
      q.push({r, x.second});
    }
  }
  for (auto i = 0; i < n; ++i) {
    if (d[i].first <= k) {
      ans[i] = d[i].second;
    } else {
      if (k % 2 == 0) {
        ans[i] = (s[i] == 'B' ? 1 : 2);
      } else {
        ans[i] = (s[i] == 'B' ? 2 : 1);
      }
    }
  }
  for (auto i = 0; i < n; ++i) {
    cout << (ans[i] == 1 ? 'B' : 'W');
  }
}
void stupid_solve() {
  ofstream file2;
  file2.open("output2.txt");
  string g = s;
  for (long long j = 0; j < k; ++j) {
    string t = g;
    for (long long i = 0; i < n; ++i) {
      long long l = left(i), r = right(i);
      long long cnt_w = (long long)(g[l] == 'W') + (long long)(g[i] == 'W') +
                        (long long)(g[r] == 'W'),
                cnt_b = (long long)(g[l] == 'B') + (long long)(g[i] == 'B') +
                        (long long)(g[r] == 'B');
      if (cnt_w > cnt_b)
        t[i] = 'W';
      else
        t[i] = 'B';
    }
    g = t;
  }
  file2 << g << "\n";
  file2.close();
}
void check() {
  ifstream file1, file2;
  file1.open("output1.txt");
  file2.open("output2.txt");
  string t1, t2;
  file1 >> t1;
  file2 >> t2;
  if (t1.length() != t2.length()) {
    cout << "length is different, " << t1.length() << ' ' << t2.length()
         << "\n";
    cout << s << "\n" << n << ' ' << k << "\n";
    cout << t1 << "\n\n" << t2 << "\n\n\n\n";
    return;
  }
  for (auto i = 0; i < t1.length(); ++i) {
    if (t1[i] != t2[i]) {
      cout << "Error in " << i << " symbol " << t1[i] << ' ' << t2[i] << "\n";
      cout << s << "\n" << n << ' ' << k << "\n";
      for (long long j = 0; j < i; ++j) {
        cout << t1[j];
      }
      cout << " " << t1[i] << " ";
      for (long long j = i + 1; j < t1.length(); ++j) cout << t1[j];
      cout << "\n\n";
      for (long long j = 0; j < i; ++j) {
        cout << t2[j];
      }
      cout << " " << t2[i] << " ";
      for (long long j = i + 1; j < t1.length(); ++j) cout << t2[j];
      cout << "\n\n\n\n";
      return;
    }
  }
  cout << "It's all OK\n\n\n\n";
  file1.close();
  file2.close();
}
