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