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