#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define pr(...) cerr<< GET_MACRO(__VA_ARGS__,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__) <<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5(a,b,c,d,e) pr1(a)<<pr4(b,c,d,e)
#define pr6(a,b,c,d,e,f) pr1(a)<<pr5(b,c,d,e,f)
#define pr7(a,b,c,d,e,f,g) pr1(a)<<pr6(b,c,d,e,f,g)
#define pr8(a,b,c,d,e,f,g,h) pr1(a)<<pr7(b,c,d,e,f,g,h)
using namespace std;
using Int = long long;
using ll = long long;
using Double = long double;
const Int INF = (1LL<<55)+1e9; // ~ 3.6 * 1e16
const Int mod = (1e9)+7;
const Double EPS = 1e-8;
const Double PI = 6.0 * asin((Double)0.5);
using P = pair<Int,Int>;
using T = tuple<Int,Int,Int>;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
ostream& operator<<(ostream& o,P p){return o<<"("<<p.first<<","<<p.second<<")";}
ostream& operator<<(ostream& o,T t){return o<<"("<<get<0>(t)<<","<<get<1>(t)<<","<<get<2>(t)<<")";}
istream& operator>>(istream& i,P &p){return i>>p.first>>p.second;}
ostream& operator<<(ostream& o,vector<auto> &a){Int i=0;for(auto t:a)o<<(i++?" ":"")<<t;return o;}
istream& operator>>(istream& i,vector<auto> &a){for(auto &t:a)i>>t;return i;}
void prArr(auto a,string s=" "){Int i=0;for(auto t:a)cout<<(i++?s:"")<<t;cout<<endl;}

deque<Int> compless(string s){
  Int n = s.size();
  Int cnt = 0;
  deque<Int> res;  
  for(Int i=0, pre = s[i] ;i<n; pre = s[i], i++, cnt++)
    if(pre != s[i]) res.push_back(cnt), cnt = 0;
  if(cnt) res.push_back(cnt);
  return res;
}

string restore(deque<Int> A,Int top){
  string res;
  for(Int a:A){
    res += string(a, (top == 'X'? 'A':'B') );
    top = top == 'O'? 'X':'O';
  }
  return res;
}


Int getType(const deque<Int> &A,Int top){
  if(top == 'X') return 0; //x....* だったらpush_front(1), 
  if(A.size() == 1) return 1; //ooooo......だったら変化なし。
  if(A.size()%2 == 1 && A.back() >= 2) return 2; //o...ooだったら先頭-1と最後+1
  if(A.size()%2 == 1 && A.back() == 1) return 3; //o...xoだったら先頭-1で最後+1
  if(A.size()%2 == 0 && A.back() >=2)  return 4;//o...xxだったら先頭を-1,push_back(1)
  return 5; //o....ox
}

void ifErase(deque<Int> &A, Int i){
  Int n = A.size();
  if(i < 0 || i >= n) return;
  if(A[i]) return;
  A.erase(A.begin() + i);
  if(i < (Int)A.size() && i - 1 >= 0) A[i-1] += A[i], A.erase(A.begin()+i);
}

Int eraseOX(deque<Int> &A,char &top){
  auto ok = [&](){
    if(A.empty() || A.size() == 1) return 0;
    if(top == 'X' && A.size()%2 == 1 && A.back() == 1) return 1;
    if(top == 'O' && A.size()%2 == 0 && A.back() == 1) return 1;
  };
  if(!ok()) return 0;
  auto dec = [&](Int i){A[i]--; ifErase(A, i);};
  A.pop_back(), dec(A.size()-1);
  return 1;
}


void update(deque<Int> &A,char &top){
  
  if(A.empty()) return;
  Int type = getType(A,top);

  auto dec = [&](Int i){
    if(--A[i] == 0 && type != 0) top = top == 'O'? 'X':'O';
    ifErase(A, i);
  };

  auto inc = [&](){
    if(A.empty()) A.push_back(0);
    A.back()++;
  };
    
  
  top = top == 'O'? 'X':'O';
  if(type == 0) A.push_front(1), dec(1);
  if(type == 1) return;
  if(type == 2) dec(0), inc();
  if(type == 3) dec(0), inc();
  if(type == 4) dec(0), A.push_back(1);
  if(type == 5) assert(0);
}

signed main(){
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  Int n, K;
  cin >>n >> K;
  string s;
  cin>>s;
  for(char &ch:s) ch = ch == 'A'? 'X':'O';
  string ofset;
  deque<Int> A = compless(s);
  char top = s[0];
  Int cnt = min(K, 1000000LL);
  K -= cnt;
  while(cnt--) {
    while(eraseOX(A,top)) ofset += "BA";
    update(A,top);
  }
  
  
  string ans = restore(A, top) + ofset;
  if(A.size() && K%2) ans[0] = ans[0] == 'A'? 'B':'A';
  cout<<ans<<endl;
  
  return 0;
}


Measured memory_bytes: 2512