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