John

Problem Description
Little John is playing very funny game with his younger brother. There is one big box filled with M&Ms of different colors. At first John has to eat several M&Ms of the same color. Then his opponent has to make a turn. And so on. Please note that each player has to eat at least one M&M during his turn. If John (or his brother) will eat the last M&M from the box he will be considered as a looser and he will have to buy a new candy box.

Both of players are using optimal game strategy. John starts first always. You will be given information about M&Ms and your task is to determine a winner of such a beautiful game.

Input
The first line of input will contain a single integer T – the number of test cases. Next T pairs of lines will describe tests in a following format. The first line of each test will contain an integer N – the amount of different M&M colors in a box. Next line will contain N integers Ai, separated by spaces – amount of M&Ms of i-th color.

Constraints:
1 <= T <= 474,
1 <= N <= 47,
1 <= Ai <= 4747

Output
Output T lines each of them containing information about game winner. Print “John” if John will win the game or “Brother” in other case.

Sample Input
2
3
3 5 1
1
1

Sample Output
John
Brother

http://blog.csdn.net/xtulollipop/article/details/52001114

问题描述
小约翰正在和他弟弟玩非常有趣的游戏。有一个大盒子装满了不同颜色的M&M。起初,约翰必须吃几个颜色相同的M&M。然后他的对手必须转弯。等等。请注意,每个球员必须吃至少一个M&M在他的轮值。如果约翰(或他的兄弟)吃了盒子里最后的M&M,他就会被认为是一个松懈的人,他将不得不买一个新的糖果盒。
双方都在使用最优的博弈策略。约翰总是先开始。您将获得有关M&MS的信息,您的任务是确定这样一个美丽的游戏的赢家。
输入
第一行输入将包含一个整数T-测试用例的数量。接下来,T对行将以以下格式描述测试。每个测试的第一行将包含一个整数N-一个框中不同M&M颜色的数量。下一行将包含N个整数AI,用空格分隔--I-色M&ms的数量.
制约因素:
1<=T<=474,
1<=N<=47,
1<=AI<=4747
输出量
输出T行,每一行包含关于游戏胜利者的信息。打印“约翰”,如果约翰将赢得比赛,或“兄弟”在其他情况下。
样本输入

2
3
3 5 1
1
1
Sample Output
John
Brother