module main; // https://mmxsrup.hatenablog.com/entry/2016/09/14/101621 より // Grundy数、素因数分解、Nim import std; // xを素因数分解して[素因数、指数]の配列を返す Tuple!(T, int)[] factorize(T)(T x) { typeof(return) res; void addFactor(T n) { auto f = tuple(n, 0); while (x % n == 0) { x /= n; ++f[1]; } if (f[1]) res ~= f; } addFactor(2); // まず2で割る for (T d = 3; d * d <= x; d += 2) { // 3以上の奇数で割っていく addFactor(d); } if (x > 1) res ~= tuple(x, 1); // ここまで残っているxは素数のはず return res; } void main() { // 入力 int N = readln.chomp.to!int; auto M = readln.split.to!(int[]); // 答えの計算 int sum = 0; foreach (m; M) { foreach (f; factorize(m)) { // 一度に取り除けるのは2つまでなので、3で割った余りをとる sum ^= f[1] % 3; } } // 答えの出力 if (sum == 0) writeln("Bob"); else writeln("Alice"); }