#include <bits/stdc++.h>
using namespace std;
int main() {
  int tot, time;
  while (cin >> tot >> time) {
    string s;
    int i;
    bool ok;
    cin >> s;
    if (s.size() == 1) {
      cout << s << endl;
      continue;
    }
    while (time--) {
      ok = false;
      for (i = 0; i < s.size() - 1; i++) {
        if (s[i] == 'B' && s[i + 1] == 'G') {
          swap(s[i], s[i + 1]);
          i++;
          ok = true;
        }
      }
      if (ok == false) break;
    }
    cout << s << endl;
  }
}
