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