N, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = [(B[i] - A[i], i )for i in range(N)] C.sort() ans = [''] * N for i in range(N): _, num = C[i] if i < K: ans[num] = 'A' else: ans[num] = 'B' print(''.join(ans))