#include<iostream>
using namespace std;
#include<cstdio>
int a[50];
int main()
{
int i,ans,T,n,temp;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
temp=0;//¹Âµ¥¶Ñ
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
if(i==0)
ans=a[i];
else
ans=ans^a[i];
if(a[i]>1) temp=1;
}
if(temp==0)
{
if(n%2==1)
printf("Brother\n");
else
printf("John\n");
continue;
}
if(ans==0)
printf("Brother\n");
else
printf("John\n");
}
return 0;
}
hdu 1907 博弈
最新推荐文章于 2019-11-14 19:37:28 发布