#P4279. [SHOI2008] 小约翰的游戏
[SHOI2008] 小约翰的游戏
Description
Little John often plays a very interesting game with his older brother: On the table there are heaps of stones. Little John and his brother take turns removing stones. On each turn, a player may choose any heap and remove any positive number of stones from that heap, but may not take zero stones. We stipulate that the player who takes the last stone loses.
Little John is quite stubborn. He insists that the first player has a big advantage, so he always moves first. His brother is much smarter and has never made a mistake in the game. In anger, Little John asks you to be his adviser. Naturally, you should first write a program to predict who will win the game.
Input Format
The input consists of multiple test cases. The first line contains an integer (), indicating there are test cases.
For each test case, the first line contains an integer (), indicating there are heaps of stones. Then follow integers, each not exceeding , representing the number of stones in each heap.
Output Format
For each test case, if John can win the game, output John; otherwise output Brother. Please pay attention to letter case.
2
3
3 5 1
1
1
John
Brother
Hint
- For of the testdata, .
- For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号