def sieve(n): "Return all primes <= n." np1 = n + 1 s = list(range(np1)) # leave off `list()` in Python 2 s[1] = 0 sqrtn = int(round(n**0.5)) for i in range(2, sqrtn + 1): # use `xrange()` in Python 2 if s[i]: # next line: use `xrange()` in Python 2 s[i*i: np1: i] = [0] * len(range(i*i, np1, i)) return list(filter(None, s)) g = int(input().strip()) for a0 in range(g): n = int(input().strip()) # your code goes here count=len(sieve(n)) if count==None: print('Bob') elif(count%2==0): print('Bob') else: print('Alice')