#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  int v, s;
  cin >> v >> s >> a;
  b = a;
  for (int q = 0; q < s; q++) {
    a = b;
    for (int w = 0; w < v; w++) {
      if ((a[w] == 'B') && (a[w + 1] == 'G')) {
        swap(b[w], b[w + 1]);
      }
    }
  }
  cout << b;
  return 0;
}
