题解详见小礼物的大神的BLOG,弱渣就不说了。。。http://dzy493941464.is-programmer.com/posts/39629.html
program p1022; var t,n,i,ans,k,j,k1,k2:longint; bo:boolean; begin read(t); for k:=1 to t do begin read(n); ans:=0; k2:=0; for i:=1 to n do begin read(k1); if k1>1 then inc(k2); ans:=ans xor k1; end; if ((ans=0) and (k2>0)) or ((ans<>0) and (k2=0)) then writeln('Brother') else writeln('John'); end; end.