import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.conv, std.stdio, std.typecons; void main() { auto n = readln.chomp.to!int; auto mi = readln.split.map!(to!int); auto pi = primes(mi.reduce!(max)); auto qi = mi.map!(m => calc(m, pi)).reduce!("a ~ b"); writeln(qi.map!("a % 3").reduce!("a ^ b") == 0 ? "Bob" : "Alice"); } int[] calc(int n, int[] pi) { int[] r; int i = 0; while (n > 1) { auto s = 0; while (n % pi[i] == 0) { s += 1; n /= pi[i]; } if (s > 0) r ~= s; i += 1; } return r; } int[] primes(int n) { auto sieve = new bool[](n + 1); sieve[0..2] = false; sieve[2..$] = true; foreach (p; 2..n.to!real.sqrt.to!int + 1) if (sieve[p]) foreach (q; iota(p * 2, n + 1, p)) sieve[q] = false; return sieve.enumerate .filter!("a[1]") .map!("a[0]").map!(to!int).array; }