import std.conv, std.functional, std.range, std.stdio, std.string; import std.algorithm, std.array, std.bigint, std.bitmanip, std.complex, std.container, std.math, std.mathspecial, std.numeric, std.regex, std.typecons; import core.bitop; class EOFException : Throwable { this() { super("EOF"); } } string[] tokens; string readToken() { for (; tokens.empty; ) { if (stdin.eof) { throw new EOFException; } tokens = readln.split; } auto token = tokens.front; tokens.popFront; return token; } int readInt() { return readToken.to!int; } long readLong() { return readToken.to!long; } string COLOR(string s = "") { return "\x1b[" ~ s ~ "m"; } bool chmin(T)(ref T t, in T f) { if (t > f) { t = f; return true; } else { return false; } } bool chmax(T)(ref T t, in T f) { if (t < f) { t = f; return true; } else { return false; } } int binarySearch(alias pred, T)(in T[] as) { int lo = -1, hi = cast(int)(as.length); for (; lo + 1 < hi; ) { const mid = (lo + hi) >> 1; (unaryFun!pred(as[mid]) ? hi : lo) = mid; } return hi; } int lowerBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a >= val)); } int upperBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a > val)); } bool solve(const(int[]) A) { bool[2] f; f[0] = true; foreach_reverse (a; A) { if (a & 1) swap(f[0], f[1]); if (a == 1) f[1] = true; } return f[1]; } void exper2() { enum N = 10; auto f = new bool[][](N, N); foreach (a; 0 .. N) foreach (b; 0 .. N) { if (a) { int aa = a - 1, bb = b; if (aa == 0) bb = 0; if (!f[aa][bb]) f[a][b] = true; } if (b) { int aa = a, bb = b - 1; if (bb == 0) {} if (!f[a][b - 1]) f[a][b] = true; } } foreach (a; 0 .. N) { writef("%2d ", a); foreach (b; 0 .. N) write(f[a][b] ? '#' : '.'); writeln; } writeln; } void exper3() { enum N = 10; auto f = new bool[][][](N, N, N); foreach (a; 0 .. N) foreach (b; 0 .. N) foreach (c; 0 .. N) { if (a) { int aa = a - 1, bb = b, cc = c; if (aa == 0) bb = cc = 0; if (!f[aa][bb][cc]) f[a][b][c] = true; } if (b) { int aa = a, bb = b - 1, cc = c; if (bb == 0) cc = 0; if (!f[aa][bb][cc]) f[a][b][c] = true; } if (c) { int aa = a, bb = b, cc = c - 1; if (cc == 0) {} if (!f[aa][bb][cc]) f[a][b][c] = true; } } foreach (a; 0 .. N) { writefln("a = %s\n", a); foreach (b; 0 .. N) { writef("%2d ", b); foreach (c; 0 .. N) write(f[a][b][c] ? '#' : '.'); writeln; } writeln; } foreach (a; 1 .. N) foreach (b; 1 .. N) foreach (c; 1 .. N) { const brt = f[a][b][c]; const grd = solve([a, b, c]); assert(brt == grd, format("%s: %s %s", [a, b, c], brt, grd)); } } void main() { // exper2; // exper3; // return; try { for (; ; ) { const numCases = readInt; foreach (caseId; 0 .. numCases) { const N = readInt; auto A = new int[N]; foreach (i; 0 .. N) A[i] = readInt; const ans = solve(A); writeln(ans ? "Alice" : "Bob"); } } } catch (EOFException e) { } }