#include <bits/stdc++.h>
using namespace std;
void FASTIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
void swap(char* a, char* b) {
  char temp = *b;
  *b = *a;
  *a = temp;
}
void solve_logic() {
  long long n, t;
  cin >> n >> t;
  string str;
  cin >> str;
  while (t--) {
    string temp = str;
    for (long long i = 0; i < n; i++) {
      if (i != 0) {
        if (str[i] != str[i - 1]) {
          if (str[i] == 'G' && str[i - 1] == 'B') {
            swap(&temp[i], &temp[i - 1]);
          }
        }
      }
    }
    str = temp;
  }
  cout << str;
}
int main() {
  FASTIO();
  solve_logic();
  return 0;
}
