#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  long long n, ta;
  cin >> n >> ta;
  string s;
  cin >> s;
  long long count = 0;
  while (ta > count) {
    for (long long i = 0; i < n - 1; i++) {
      if (s[i] == 'B' && s[i + 1] == 'G') {
        swap(s[i], s[i + 1]);
        i++;
      }
    }
    ++count;
  }
  cout << s << endl;
  return 0;
}
