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