N,K=map(int,input().split()) A=list(map(int,input().split())) B=list(map(int,input().split())) S=["B"]*N U=sorted(range(N),key=lambda i:A[i]-B[i],reverse=True) for i in U[:K]: S[i]="A" print(*S,sep="")