#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <queue>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <random>

using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
#define epr(...) fprintf(stderr, __VA_ARGS__)
#define db(x) cerr << #x << " = " << x << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n"; 
#define db3(x, y, z) cerr << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", " << z << ")\n"
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)a.size()
#define pw(n) (1ll << (n))

#define equal equalll
#define less lesss
const int N = -1;
const long long INF = 1e9 + 19;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;


char change(char ch) {
    if (ch == 'A') return 'B';
    if (ch == 'B') return 'A';
    assert(false);
}

string go(string s) {
    int n = s.size();
    int pos = 0;
    int dir = 1; 
    for (int it = 0;; it++) {
        //db3(s, pos, dir);
        if (pos == -1) break;
        if (pos == n) break;
        if (s[pos] == 'A') {
            s[pos] = change(s[pos]);
            pos -= dir;
            dir *= -1;
        }
        else if (s[pos] == 'B') {
            s[pos] = change(s[pos]); 
            pos += dir;
        }
        //db2(pos, dir);
    }
    return s;
}


int n, k;
string s;

void read() {
    cin >> n >> k;
    cin >> s;
}

string solve() {
    vector<int> pos; 
    for (int i = 0; i + 1 < n; i++) {
        if (s[i] == 'B' && s[i + 1] == 'A') {
            pos.pb(i);
        }
    }
    pos.pb(n);
    int prev = 0;    
    vector<int> seg;
    //db(pos.size());
    for (int i = 0; i < (int)pos.size(); i++) {
        int cur = prev;
        for (;cur < pos[i] && s[cur] == 'A'; cur++);
        seg.pb(cur - prev); 
        prev = cur;
        for (; cur < pos[i] && s[cur] == 'B'; cur++);
        seg.pb(cur - prev);
        prev = pos[i] + 2;
    }
    int type = 0;
    reverse(all(seg)); 

    //for (auto x: seg)
        //db(x);
    //cerr << endl;

    for (; k > 0 && !seg.empty();) {
        k--;
        if (type == 0 && seg.back() == 0) {
            seg.pop_back();
            type = 2;
        }

        //db2(type, seg.size());
        //for (auto x: seg)
            //cerr << x << " ";
        //cerr << endl;
        if (type == 0) {
            if (seg.back() >= 2) {
                seg.back() -= 2;
                type = 1;
            }  
            else {
                if (seg.back() == 1) {
                    seg.pop_back(); 
                    //assert(!seg.empty());
                    if (seg.empty()) {
                        seg.pb(1);
                        if (k % 2 == 0) {
                            type = 2;
                            //db("SSSSSSSSSSSSS");
                        }
                        else
                            type = 0;
                        db("!!!!!");
                        break;
                    }
                    else {
                        seg.back()++;
                    }
                    type = 2;
                }
                assert(!seg.empty());
            }
        }
        else if (type == 1) {
            type++;
        }
        else if (type == 2) {
            type = 0;
        }
    }
    //db(seg.size());

    string res;
    for (; !seg.empty(); ) {
        if (type == 1) {
            res += "BA";
            type = 0;
        }
        else if (type == 0) {
            for (int i = 0; i < (int)seg.back(); i++) {
                res += "A";
            }
            seg.pop_back();
            type = 2;
        }
        else if (type == 2) {
            for (int i = 0; i < (int)seg.back(); i++) {
                res += "B";
            }
            seg.pop_back();
            type = 1;
        }
    }
    assert((n - (int)res.size()) % 2 == 0);
    for (;(int)res.size() < n; )
        res += "BA";

    return res;
}

void genTest() {
    n = rand() % 5 + 1;
    k = rand() % 20 + 1;
    s.clear();
    for (int i = 0; i < n; i++)
        s += 'A' + rand() % 2;
}

string stupid() {
    string t = s;
    for (int i = 0; i < k; i++) {
        t = go(t);
    }
    return t;
}

void stress() {
    for (int tt = 0; ; tt++) {
        cerr << "-------------------------" << endl;
        db(tt);
        genTest();
        db2(n, k);
        db(s);
        auto r2 = stupid();
        auto r1 = solve();
        db2(r1, r2);
        assert(r1 == r2);
    }
}


int main(){
#ifdef HOME 
    freopen("in", "r", stdin);
#endif
    if (1) {
        read();
        //cout << stupid() << endl;
        cout << solve() << endl;
    }
    else {
        stress();
    }
    return 0;
}



Measured memory_bytes: 2044