Last Coin Loses
There are n piles of coins on the table; pile i holds a_i coins (some piles may already be
empty). Alice and Bob take turns, Alice first. On a turn, the player chooses one non-empty pile and
removes any positive number of coins from it (possibly the whole pile).
The player who takes the very last coin on the table loses.
Both players play optimally. For each of several independent games, determine the winner.
Input
The first line contains T (1 ≤ T ≤ 10^5), the number of games.
Each game is described by two lines. The first contains n (1 ≤ n ≤ 10^5), the number of piles. The
second contains n integers a_1, a_2, …, a_n (0 ≤ a_i ≤ 10^18), the pile sizes. At least one pile
is non-empty.
The sum of n over all games does not exceed 10^5.
Output
For each game print one line: Alice if Alice wins with optimal play, otherwise Bob.
Notes
In the first example, the first game is a single pile of 1 coin: Alice is forced to take it and loses. In the second game (piles 1 and 1) Alice takes one coin, and Bob must take the last one. In the third game (a single pile of 5) Alice takes 4 coins and leaves Bob the last one. In the fourth game (piles 1, 2 and 3) every move Alice makes can be answered by Bob so that Alice eventually takes the last coin.
In the second example, the empty pile does not matter: with piles 1 and 1 Alice wins, and with piles 2 and 2 Bob mirrors Alice's moves until he can leave her a single coin.