#include <bits/stdc++.h>
using namespace std;
char s[50];
void swap(int i, int j) {
  char tmp = s[i];
  s[i] = s[j];
  s[j] = tmp;
}
int main(void) {
  ios_base::sync_with_stdio(0);
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  int n = 0, t = 0;
  char aux[50];
  cin >> n >> t;
  cin >> s;
  memcpy(aux, s, 50);
  while (t--) {
    for (int i = 0, j = 1; i < n; i++, j++) {
      if (s[i] == 'B' && s[j] == 'G') {
        swap(i, j);
        i++;
        j++;
      }
    }
  }
  cout << s << endl;
}
