import sys input = sys.stdin.readline from collections import * N, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) d = [(i, A[i]-B[i]) for i in range(N)] d.sort(key=lambda t: t[1], reverse=True) ans = ['B']*N for i, _ in d[:K]: ans[i] = 'A' print(''.join(ans))