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