#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
using namespace std;
int pd[1010000],K,n,w[210000],bo[210000],ans[210000];
char ch[210000];
queue<int>Q;
void print(){
	for (int i=1;i<=n;i++) if (ans[i]) putchar('A'); else putchar('B');
	exit(0);
}
int main(){
	scanf("%d%d",&n,&K);
	scanf("%s",ch+1);
	for (int i=1;i<=n;i++) if (ch[i]=='A') pd[i]=1; else pd[i]=0;
	int l=1,now=0;
	for (;K;K--){
	//	cout<<"fa "<<K<<" "<<l<<endl;
	//	for (int i=1;i<=n;i++) cout<<(pd[l+i-1]^now)<<" "; cout<<endl;
		if (l>n){
			if ((n&1)&&(pd[l]^now)==1){
				for (int i=1;i<=n;i++) ans[i]=i&1;
				if (K&1) ans[1]=0;
				print();
			}
			if (n%2==0){
				for (int i=1;i<=n;i++) ans[i]=(i&1)^1;
				print();
			}
		}
		if (pd[l]==now){
			l++; pd[l+n-1]=now; now^=1;
		} else pd[l]^=1;
	}
	for (int i=1;i<=n;i++) ans[i]=pd[i+l-1]^now;
	print();
}