#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>
using namespace std;
typedef long long LL;
const int N=2e5+100;
int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}
int main()
{
	int n=gi(),k=gi(),i;char c;
	deque<bool>q;bool o=0;
	for (i=1;i<=n;i++,q.push_back(c-'A'))
		while ((c=getchar())!='A'&&c!='B');
	if (k<=n*2) {
		while (k--)
			if (o^q.front())
				q.pop_front(),o^=1,q.push_back(o);
			else
				q.pop_front(),q.push_front(!o);
		for (i=1;i<=n;i++) putchar((o^q.front())+'A'),q.pop_front();
	} else {
		if (n&1) putchar('A'+!(k&1));
		for (i=n>>1;i;i--) putchar('B'),putchar('A');
	}
	return 0;
}