import collections import math def factorize(n): ''' returns a list of prime factors of n. ex. factorize(24) = [2, 2, 2, 3] source: Rossetta code: prime factorization (slightly modified) http://rosettacode.org/wiki/Prime_decomposition#Python:_Using_floating_point ''' step = lambda x: 1 + (x<<2) - ((x>>1)<<1) maxq = int(math.floor(math.sqrt(n))) d = 1 q = n % 2 == 0 and 2 or 3 while q <= maxq and n % q != 0: q = step(d) d += 1 return q <= maxq and [q] + factorize(n//q) or [n] def solve(N, Ms): piles = [] for m in Ms: piles.extend(collections.Counter(factorize(m)).values()) c = piles[0] % 3 for p in piles[1:]: c ^= p % 3 if c == 0: print('Bob') else: print('Alice') N = int(input()) Ms = list(map(int, input().split())) solve(N, Ms)