#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, t;
  cin >> n >> t;
  char c[n];
  for (long long i = 0; i < n; i++) {
    cin >> c[i];
  }
  while (t--) {
    for (long long i = 0; i < n - 1;) {
      if (c[i] == 'B' && c[i + 1] == 'G') {
        swap(c[i], c[i + 1]);
        i += 2;
      } else
        i++;
    }
  }
  for (long long i = 0; i < n; i++) {
    cout << c[i];
  }
}
