#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  int n, times;
  cin >> n >> times;
  cin >> a;
  while (times--) {
    for (int i = 0; i < a.size() - 1; i++) {
      if (a[i] == 'B' && a[i + 1] == 'G') {
        swap(a[i], a[i + 1]);
        i++;
      }
    }
  }
  cout << a;
}
