#include <bits/stdc++.h>
using namespace std;
const long long M = 1e6 + 5;
const double pi = acos(-1.);
const long long dx[] = {1, 0, -1, 0, -1, -1, 1, 1};
const long long dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
long long a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, t, u, v, w, x,
    y, z, maxi, mini, ans, mid, low, high, sum, total;
string s1, s2;
int main() {
  cin >> n >> t >> s1;
  for (j = 0; j < t; j++) {
    for (i = 1; i < n; i++) {
      if (s1[i] == 'G' && s1[i - 1] == 'B') {
        swap(s1[i], s1[i - 1]);
        i++;
      }
    }
  }
  cout << s1;
}
