#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, t;
  cin >> n >> t;
  string s;
  cin >> s;
  for (long long int i = 0; i < t; i++) {
    for (long long int j = 0; j < n - 1; j++) {
      if (s[j] == 'B' && s[j + 1] == 'G') {
        s[j] = 'G';
        s[j + 1] = 'B';
        j = j + 1;
      }
    }
  }
  for (long long int i = 0; i < n; i++) {
    cout << s[i];
  }
  cout << endl;
  return 0;
}
