import sys input = sys.stdin.readline N,K=map(int,input().split()) A=list(map(int,input().split())) B=list(map(int,input().split())) X=[(A[i]-B[i],i) for i in range(N)] X.sort(reverse=True) ANS=["B"]*N for i in range(K): ANS[X[i][1]]="A" print("".join(ANS))