#include<bits/stdc++.h>
using namespace std;
int main(){
int n,t;
char a[55];
cin>>n>>t;
cin>>a;
while(t--){
for(int i=0;i<n-1;i++){
if(a[i]=='B' && a[i+1]=='G'){
swap(a[i],a[i+1]);
i++;
}
}
}
cout<<a<<"\n";
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCl7CgogICAgaW50IG4sdDsKICAgIGNoYXIgYVs1NV07CiAgICBjaW4+Pm4+PnQ7CiAgICBjaW4+PmE7CgogICAgd2hpbGUodC0tKXsKICAgICAgICBmb3IoaW50IGk9MDtpPG4tMTtpKyspewogICAgICAgICAgICBpZihhW2ldPT0nQicgJiYgYVtpKzFdPT0nRycpewogICAgICAgICAgICAgICAgc3dhcChhW2ldLGFbaSsxXSk7CiAgICAgICAgICAgICAgICBpKys7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgY291dDw8YTw8IlxuIjsKCgp9