n,k = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) ans = ["B"]*n L = [[a-b,i] for i,(a,b) in enumerate(zip(A,B))] L.sort(reverse=True) for i in range(k): ans[L[i][1]] = "A" print(*ans,sep="")