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