Alice's Divisor Countdown
Alice and Bob are bored at the bus stop, so they write a positive integer n on the back of a ticket
and start counting it down. They take turns, and Alice moves first. On a turn, the player picks a
number d that divides the current n with 1 ≤ d < n, crosses n out and writes n − d instead.
A player who has no allowed d on their turn loses (this happens exactly when the number on the
ticket is 1).
Alice and Bob play a game for each of several starting numbers. Both of them play optimally. For every starting number, find out who wins.
Input
The first line contains an integer t (1 ≤ t ≤ 10^5), the number of games.
Each of the next t lines contains one integer n (1 ≤ n ≤ 10^18), the starting number of a game.
Output
For each game, print Alice if Alice wins with optimal play and Bob otherwise, one per line.
Notes
In the first example:
- With
n = 1, Alice has no move and loses immediately. - With
n = 2, Alice subtracts1, leaving1for Bob, who cannot move. - With
n = 3, the only divisor below3is1, so Alice must write2; Bob then writes1and Alice is stuck. - With
n = 4, Alice subtracts1and leaves Bob with3, a losing position as shown above. (Subtracting2would hand Bob the winning position2.)