mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline N, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = [] for i in range(N): C.append((B[i] - A[i], i)) C.sort(key=lambda x: x[0]) ans = ["B"] * N for i in range(K): ans[C[i][1]] = "A" print("".join(ans)) if __name__ == '__main__': main()