#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  char s[100];
  while (~scanf("%d%d", &n, &t)) {
    scanf("%s", s);
    while (t--) {
      for (int i = 1; i < n; ++i)
        if (s[i - 1] == 'B' && s[i] == 'G') s[i - 1] = 'G', s[i] = 'B', ++i;
    }
    printf("%s\n", s);
  }
}
