#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <fstream>
#include <queue>
#define rep(i, l, r) for(int i = l; i <= r; i++)
#define down(i, l, r) for(int i = l; i >= r; i--)
#define MS 1234
#define MAX 1037471823
using namespace std;
int t, n, m, a, b, c;
int main()
{
scanf("%d", &t);
while (t-- > 0)
{
scanf("%d", &n);
a = b = c = 0;
rep(i, 1, n)
{
scanf("%d", &m);
if (m == 1) a++; else b++;
c = c ^ m;
}
if ((c > 0 && (b > 0)) || (c == 0 && (b == 0))) printf("John\n"); else printf("Brother\n");
}
}
I2luY2x1ZGUgPGNzdHJpbmc+CiNpbmNsdWRlIDxjbWF0aD4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDxjc3RkaW8+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGZzdHJlYW0+CiNpbmNsdWRlIDxxdWV1ZT4KCiNkZWZpbmUgcmVwKGksIGwsIHIpIGZvcihpbnQgaSA9IGw7IGkgPD0gcjsgaSsrKQojZGVmaW5lIGRvd24oaSwgbCwgcikgZm9yKGludCBpID0gbDsgaSA+PSByOyBpLS0pCiNkZWZpbmUgTVMgMTIzNAojZGVmaW5lIE1BWCAxMDM3NDcxODIzCgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IHQsIG4sIG0sIGEsIGIsIGM7CgppbnQgbWFpbigpCnsKCXNjYW5mKCIlZCIsICZ0KTsKCXdoaWxlICh0LS0gPiAwKSAKCXsKCQlzY2FuZigiJWQiLCAmbik7CgkJYSA9IGIgPSBjID0gMDsKCQlyZXAoaSwgMSwgbikgCgkJewoJCQlzY2FuZigiJWQiLCAmbSk7CgkJCWlmIChtID09IDEpIGErKzsgZWxzZSBiKys7CgkJCWMgPSBjIF4gbTsKCQl9CgkJaWYgKChjID4gMCAmJiAoYiA+IDApKSB8fCAoYyA9PSAwICYmIChiID09IDApKSkgcHJpbnRmKCJKb2huXG4iKTsgZWxzZSBwcmludGYoIkJyb3RoZXJcbiIpOwoJfQp9