n, x, y = [int(x) for x in input().split()]
a = [0] * n
b = [0] * n
vec = []
for i in range(n):
a[i], b[i] = [int(x) for x in input().split()]
vec += [(b[i] - a[i], i)]
vec.sort(key = lambda x: -x[0])
cnt = 0
for a in vec:
if a[0] > 0:
cnt += 1
cnt = min(cnt, y)
cnt = max(cnt, n - x)
ANS = [0] * n
for i in range(cnt):
ANS[vec[i][1]] = 1
for x in ANS:
print('B' if x == 1 else 'A', end='')