#include <bits/stdc++.h>
int main() {
  int n, t;
  scanf("%i %i\n", &n, &t);
  char s[n + 1];
  s[0] = '\0';
  scanf("%s\n", s);
  for (int i = 0; i < t; i++) {
    for (int j = 0; j < strlen(s); j += 1) {
      if (s[j] == 'B' && s[j + 1] == 'G') {
        s[j] = 'G';
        s[j + 1] = 'B';
        j++;
      }
    }
  }
  printf("%s\n", s);
}
