#include <bits/stdc++.h>
#define pb push_back
#define cmin(a,b) (a>b?a=b:a)
#define cmax(a,b) (a<b?a=b:a)
#define lop(i,s,t) for(int i=s;i<(t);++i)
#define rep(i,s,t) for(int i=s;i<=(t);++i)
#define dec(i,s,t) for(int i=s;i>=(t);--i)
#define fore(i,v) for(int i=g[v],d=es[i].d;i;i=es[i].nxt,d=es[i].d)
using namespace std;

#define Pr(f,...) fprintf(stderr,f,##__VA_ARGS__),fflush(stderr)

const int N=5e5+50; 

int n,k,a[N];
char s[N]; 
int main(int argc,char *argv[]){
#ifdef CURIOUSCAT
	freopen("dat.in","r",stdin);
	//freopen("my.out","w",stdout);
#endif
	scanf("%d%d%s",&n,&k,s); 
	lop(i,0,n)a[i]=s[i]=='B';
	//maintaining [p,p+n)^flag
	int p=0,q=p+n;//[p,p+n)
	bool flag=0;
	while(k--){
		if(a[p]^flag==0)a[p]=1^flag; 
		else{
			flag^=1;
			a[q]=0^flag;
			if(++p>=N)p=0; 
			if(++q>=N)q=0; 
		}
	}
	lop(i,0,n)printf("%c",(a[(p+i)%N]^flag)?'B':'A'); 
	return 0;
}