## Pile Game

Time Limit: 1 sec
Memory Limit: 64 MB
Attempts: 0
Accuracy: 0.00%
Author: Akashdeep Goel

A and B are playing a game. They start with two piles of p and q chips, respectively. A and B take a move alternately(A starts the game). A move consists of removing any pile and splitting the other pile into two piles (of any sizes). The loser is the one who cannot make a move any more. Can you decide who will win the game, assuming both the players play optimally?

Input

An integer T, denoting the number of test cases (T <= 100000). Each test case contains two integers p and q, the size of the two piles.

Constraints

1 <= p <= 10^18

1 <= q <= 10^18

1 <= T <= 100000

Output

For every test case print â€œAâ€ if A wins or â€œBâ€ if B wins in a new line.

Sample Input

3

1 3

5 6

6 7

Sample Output

B

A

A

ID

SUBMITTED AT

STATUS

LANGUAGE

TIME

MEMORY USED

USER

TIME

STATUS

LANGUAGE

TIME

MEMORY USED

2 years ago

cpp

0.08 sec

4292 KB

2 years ago

cpp

0.65 sec

392 KB

2 years ago

cpp

0.09 sec

312 KB