n, k = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) dif = [[0, i] for i in range(n)] for i in range(n): dif[i][0] = A[i] - B[i] dif.sort(key=lambda x: x[0], reverse=True) ans = ["B" for _ in range(n)] for i in range(k): ind = dif[i][1] ans[ind] = "A" print("".join(ans))