#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  char tmp;
  vector<int> v;
  cin >> n >> t;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (tmp == 'G')
      v.push_back(1);
    else if (tmp == 'B')
      v.push_back(0);
  }
  for (int i = 0; i < t; i++) {
    for (int k = 0; k < v.size(); k++) {
      if (v[k] == 0 && v[k + 1] == 1) {
        v[k] = 1;
        v[k + 1] = 0;
        k++;
      }
    }
  }
  for (int i : v) {
    if (i == 0)
      cout << "B";
    else
      cout << "G";
  }
}
