#SDNU1251. G.请回答Alice和Bob
G.请回答Alice和Bob
Description
Alice and Bob are playing the following modified version of Nim game:
1.There are n piles of stones denoted as
2. is a prime number;
Alice always plays first, and Bob and he move in alternating turns. During each turn, the current player must perform either of the following two kinds of moves:
1.Choose one pile and remove stones from it;
2.Remove stones from all piles, where the size of the smallest pile. This move becomes unavailable if any pile is empty.
· Each player moves optimally, meaning they will not make a move that causes them to lose if there are still any better or winning moves.
Giving the initial situation of each game, you are required to figure out who will be the winner
Format
Input
The first contains an integer, , denoting the number of games. The subsequent lines describe each game over two lines:
- The first line contains a prime integer, , denoting the number of piles.
- The second line contains space-separated integers describing the respective values of
·
· , where is a prime.
· where
Output
For each game, print the name of the winner on a new line (i.e., either or )
Samples
2
3
2 3 2
2
2 1
Alice
Bob