#include <bits/stdc++.h>
void swap(char *c1, char *c2);
int main() {
  char seq[50];
  int n, t, i;
  scanf("%d%d%s", &n, &t, seq);
  while (t--) {
    for (i = 0; i < n - 1; i++) {
      if (seq[i] == 'B' && seq[i + 1] == 'G') {
        swap(&seq[i], &seq[i + 1]);
        i++;
      }
    }
  }
  printf("%s", seq);
  return 0;
}
void swap(char *c1, char *c2) {
  char temp = *c1;
  *c1 = *c2;
  *c2 = temp;
}
