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] ,reverse=True) ans_A = [False for _ in range(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)