import numpy as np n = int(input()) for _ in range(n): a, b = map(int, input().split()) print(chr(61 + np.sign(a - b)))