//http://wenku.baidu.com/link?url=hdO-izu3ggfWlLUkg9YTHcU28Z1TDzVHtXzDSDnDl4yVyTMjcA3i1qb9BNbJMVbSRm2q9D5MpN12DQNX_N1J4NJhb2larJdiw7-o8Ki9Hqa #include int main() { int T, n, x; scanf("%d", &T); while (T--) { scanf("%d", &n); int ans = 0, f = 1; while (n--) { scanf("%d", &x); ans ^= x; if (x != 1) f = 0; } ans = ans ? 1 : 0; puts(f ^ ans ? "John" : "Brother"); } return 0; }