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