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