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