#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int n, t;
  cin >> n >> t;
  string queue;
  cin >> queue;
  string modified = queue;
  for (int i = 0; i < t; i++) {
    int index = 0;
    while (index < n) {
      if (index < n - 1 && queue[index] == 'B' && queue[index + 1] == 'G') {
        modified[index] = queue[index + 1];
        modified[index + 1] = queue[index];
        index += 2;
      } else {
        modified[index] = queue[index];
        index++;
      }
    }
    queue = modified;
  }
  cout << modified;
  return 0;
}
