#include <bits/stdc++.h>
using namespace std;

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define UB upper_bound
#define LB lower_bound
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int n, k;
string s;


char d(char c) { return (c == 'A' ? '.' : 'B'); }

void print1(string str) {
	cout << d(str[0]) << d(str[1]) << " ";
	//if(str[0] == 'A') { cout << endl; return; }
	
	char p = '@';
	int num = 0;
	incID(i, 1, n) {
		int j = i;
		while(str[i] == str[j]) { j++; }
		
		// inc(k, j - i) { cout << d(str[i]); }
		inc(k, j - i) {
			if(k == 0) { cout << j - i; } else { }// cout << '-'; }
		}
		
		i = j - 1;
	}
	cout << endl;
}

void print2(string str) {
	// if(str[0] == 'A') { return; }
	inc(i, n) { cout << d(str[i]); } cout << endl;
}

void print(string str) { print2(str); }



int main() {
	cin >> n >> k >> s;
	
	string t = s;
	 n = s.size();///////
	
	if(n == 1) { cout << (k % 2 == 0 ? "B" : "A") << endl; return 0; }
	if(k == 0) { cout << s << endl; return 0; }
	
	// dec(i, n) { if(s[i] == 'B') { s[i] = 'A'; } else { break; } }
	
	s += '#';
	deque<int> deq;
	incID(i, 1, n) {
		int j = i;
		while(s[i] == s[j]) { j++; }
		deq.PB(j - i);
		
		i = j - 1;
	}
	
	const int AA = 0, AB = 1, BA = 2, BB = 3;
	int v;
	if(s[0] == 'A' && s[1] == 'A') { v = AA; }
	if(s[0] == 'A' && s[1] == 'B') { v = AB; }
	if(s[0] == 'B' && s[1] == 'A') { v = BA; }
	if(s[0] == 'B' && s[1] == 'B') { v = BB; }
	
	int pc = 0;
	inc(i, k) {
		/*
		if(v == AA || v == AB) { cout << "."; }
		if(v == BA || v == BB) { cout << "B"; }
		char p;
		if(v == AA || v == BA) { p = '.'; } else { p = 'B'; }
		inc(i, deq.size()) {
			inc(j, deq[i]) { cout << p; }
			p = (p == '.' ? 'B' : '.');
		}
		cout << endl;
		*/
		
		
		if(v == AA) { v = BA; continue; }
		if(v == AB) { v = BB; continue; }
		
		if(n <= pc) {
			if(n % 2 == 1 && (k - i) % 2 != 0) {
				v = (v == BA ? AA : AB);
			}
			break;
		}
		
		deq[0]--;
		if(s[n - 1] == 'B') {
			deq[deq.size() - 1]++;
			s[n - 1] = 'A';
		} else { deq.PB(1); }
		pc++;
		if(deq[0] == 0) {
			deq.pop_front();
			v = (v == BA ? BA : AB);
		} else {
			v = (v == BA ? BB : AA);
		}
	}
	
	if(v == AA || v == AB) { cout << "A"; }
	if(v == BA || v == BB) { cout << "B"; }
	
	char p;
	if(v == AA || v == BA) { p = 'A'; } else { p = 'B'; }
	inc(i, deq.size()) {
		inc(j, deq[i]) { cout << p; }
		p = (p == 'A' ? 'B' : 'A');
	}
	cout << endl;
	
	/*
	s = t;
	s += "Z";
	cout << endl;
	inc(i, k) {
		print(s);
		
		int p = 0, v = 1;
		while(inID(p, 0, n)) {
			if(s[p] == 'A') { s[p] = 'B'; v *= -1; p += v; }
			else            { s[p] = 'A'; v *= +1; p += v; }
		}
	}
	
	print(s);
	*/
	
	return 0;
}


Measured memory_bytes: 1668