#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, k;
  string ch;
  cin >> n >> t;
  cin >> ch;
  for (int i = 1; i <= t; i++) {
    for (int j = 0; j < n - 1; j++) {
      if ((ch[j] == 'B') && ch[j + 1] == 'G') {
        char aux;
        aux = ch[j];
        ch[j] = ch[j + 1];
        ch[j + 1] = aux;
        j++;
      }
      if ((ch[j] == 'B') && ch[j + 1] == 'B') {
        char aux;
        aux = ch[j];
        ch[j] = ch[j + 1];
        ch[j + 1] = aux;
      }
    }
  }
  cout << ch;
  return 0;
}
