#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  cin >> n >> t;
  string s;
  cin >> s;
  while (t--) {
    vector<int> indx;
    for (int i = 1; i < n; ++i) {
      if (s[i] == 'G' && s[i - 1] == 'B') {
        indx.push_back(i);
      }
    }
    if (indx.size() == 0) break;
    for (auto i : indx) {
      swap(s[i], s[i - 1]);
    }
  }
  cout << s;
}
