#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int n,k; cin>>n>>k; vector A(n),B(n); rep(i,n) cin>>A[i]; rep(i,n) cin>>B[i]; vector> P(n); rep(i,n) P[i]={A[i]-B[i],i}; sort(ALL(P)); reverse(ALL(P)); vector D(n); rep(i,k) D[P[i].second]=1; rep(i,n){ if(D[i]) cout<<'A'; else cout<<'B'; } cout<