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