#include <bits/stdc++.h>
using namespace std;
int n, t;
string s, s1;
int main() {
  cin >> n >> t;
  cin >> s;
  s1 = s;
  for (int i = 0; i < t; i++) {
    for (int i = 0; i < n - 1; i++) {
      if (s[i] == 'B' && s[i + 1] == 'G') {
        s1[i] = s[i + 1];
        s1[i + 1] = s[i];
      }
    }
    s = s1;
  }
  cout << s;
  cout << endl;
}
