#include <bits/stdc++.h>
using namespace std;
int main() {
  int lenth, time;
  cin >> lenth >> time;
  getchar();
  time;
  char arr[lenth + 4];
  gets(arr);
  while (time--) {
    for (int i = 0; i < (lenth - 1); i++) {
      int j = i + 1;
      if (arr[i] == 'B' && arr[j] == 'G') {
        swap(arr[i], arr[j]);
        i++;
      }
    }
  }
  printf("%s", arr);
}
