N,K = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) board = [] for i in range(N): board.append((A[i]-B[i],i)) board.sort(key = lambda x:x[0]) board.reverse() ans_A = [False] * N for i in range(K): t,index = board[i] ans_A[index] = True ANS = '' for i in range(N): if ans_A[i]: ANS += 'A' else: ANS += 'B' print(ANS)