program bzoj1022;
var t,n,i,ans,k,j,k1,k2:longint;
bo:boolean;
begin
read(t);
for k:= to t do begin
read(n);
ans:=; k2:=;
for i:= to n do begin
read(k1);
if k1> then inc(k2);
ans:=ans xor k1;
end;
if ((ans=) and (k2>)) or ((ans<>) and (k2=)) then writeln('Brother') else writeln('John');
end;
end.