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