#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, m;
  char a[55], *q, t;
  while (~scanf("%d%d", &n, &m)) {
    scanf("%s", a);
    for (i = 0; i < m; i++) {
      q = a;
      while (*q != '\0') {
        if (*q == 'B' && *(q + 1) != '\0' && *(q + 1) != 'B') {
          t = *q;
          *q = *(q + 1);
          *(q + 1) = t;
          q++;
        }
        if (*q != '\0')
          q++;
        else
          break;
      }
    }
    printf("%s\n", a);
  }
  return 0;
}
