#P1110. Alice and Bob

    ID: 126 Type: Default 2000ms 256MiB Tried: 9 Accepted: 2 Difficulty: 10 Uploaded By: Tags>博弈论SG定理多校训练牛客多校

Alice and Bob

Description

Alice and Bob like playing games. There are two piles of stones with numbers nandm{n} and {m} . Alice and Bob take turns to operate, each operation can take away k(k>0){k}(k>0) stones from one pile and take away s×k(s0)s \times k(s \geq 0) stones from another pile. Alice plays first. The person who cannot perform the operation loses the game.

Input

The first line contains an integer T(1T104))T(1 \le T \le 10^4)) denotes the total number of test cases. Each test case contains two integers n,m(1n,m5×103)) n,m(1 \le n,m \leq 5 \times 10^3)) in a line, indicating the number of two piles of stones.

Output

For each test case, print "Alice" if Alice will win the game, otherwise print "Bob".

Samples

5
2 3
3 5
5 7
7 5
7 7
Bob
Alice
Bob
Bob
Alice

Limitation

1s, 1024KiB for each test case.