#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, t;
  cin >> n >> t;
  string s;
  cin >> s;
  while (t--) {
    for (int i = 0; i < n - 1; ++i) {
      if (s.at(i) == 'B' and s.at(i + 1) == 'G') {
        swap(s.at(i), s.at(i + 1));
        i++;
      }
    }
  }
  cout << s << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}
