N, K = map(int, input().split()) A = map(int, input().split()) B = map(int, input().split()) D = [(b - a, i) for i, (a, b) in enumerate(zip(A, B))] D.sort() ans = ['B'] * N for x, i in D[:K]: ans[i] = 'A' print(''.join(map(str, ans)))