#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int T;
cin>>T;
while (T-- )
{
int flag=0;
int sky,skyzo=0;
int n;
cin>>n;
for (int i = 0; i < n; i ++ )
{
cin>>sky;
if(sky!=1)
flag++;
skyzo^=sky;
}
if(!flag)
{
if(n%2)cout<<"Brother"<<endl;
else cout<<"John"<<endl;
}
else
{
if(skyzo)cout<<"John"<<endl;
else cout<<"Brother"<<endl;
}
}
}