n,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=[(a[i]-b[i],i) for i in range(n)] c.sort() q=["B"]*n for i in range(k): q[c[~i][1]]="A" print("".join(q))