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