Poker Nim is another -player game that's a simple variation on a Nim game. The rules of the games are as follows:
The players move in alternating turns. During each move, the current player must perform either of the following actions:
At least chip must be added or removed during each turn.
Given the values of , , and the numbers of chips in each of the piles, determine whether the person who wins the game is the first or second person to move. Assume both players move optimally.
The first line contains an integer, , denoting the number of test cases.
Each of the subsequent lines defines a test case. Each test case is described over the following two lines:
For each test case, print the name of the winner on a new line (i.e., either or ).
2 1 3