#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, t;
  cin >> n >> t;
  string s;
  cin >> s;
  string y = s;
  sort(y.begin(), y.end());
  reverse(y.begin(), y.end());
  if (s == y) {
    cout << s;
    return 0;
  }
  long long sec = 0;
  while (t > 0) {
    for (int i = 0; i < n; i++) {
      if (s[i] == 'B' && s[i + 1] == 'G') {
        char temp = s[i];
        s[i] = s[i + 1];
        s[i + 1] = temp;
        i++;
      }
    }
    if (s == y) {
      cout << s;
      return 0;
    }
    t--;
  }
  cout << s;
  return 0;
}
