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