Read problem statements in [Mandarin], [Bengali], [Russian], and [Vietnamese] as well.

Alice and Bob have got an integer N. They decide to play a game. Alice and Bob make alternating moves: Alice makes the first move, Bob makes the second move, Alice makes the third one, and so on. The game continues until N becomes 0. The player who is unable to make a move loses.

During each turn a player can make one of the following moves:

1. Choose an integer X such that X can be expressed as 2^{Y}, Y ≥ 1. The chosen X must also be a factor of N. After choosing an integer X which satisfies the mentioned criteria, the player will divide N by X. 

2. If Move 1 is not possible , the player will subtract 1 from N.

Predict the winner of the game if the game is played optimally by both the players.

------ Input Format ------ 

- The first line of input contains a single integer T denoting the number of test cases. The description of T test cases follows.

- The first line of each test case contains an integer N.

------ Output Format ------ 

For each test case, print "Alice" if Alice wins the game else print "Bob". Print the output without quotes.

------ Constraints ------ 

$1 ≤T ≤2*10^{5}$

$1 ≤N ≤10^{18} $

------ subtasks ------ 

10 points : $1 ≤ N ≤ 20$ ,  $1 ≤ T ≤ 20$
30 points : $1 ≤ N ≤ 10^{5}$,  $1 ≤ T ≤ 10^{5}$
60 points : $1 ≤ N ≤ 10^{18}$

----- Sample Input 1 ------ 
2
1
2

----- Sample Output 1 ------ 
Alice
Bob
----- explanation 1 ------ 
Test case $1$: Alice can't perform the first move, hence she subtracts 1 from $N$ and $N$ becomes $0$. Bob can't make a move now.

Test case $1$: Alice first divides $N$ by $2$ , after which $N$ becomes $1$. Bob, in the next move decrements $N$ by $1$ after which $N$ becomes $0$ and Alice loses.

Source: codechef | Difficulty: MEDIUM_HARD
Tags: Mathematics

Ad-hoc


Solutions:
def snek(n):
	return n & n - 1 == 0
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print('Alice')
	elif n == 2:
		print('Bob')
	elif snek(n) or snek(n + 1):
		print('Alice')
	elif snek(n + 2):
		print('Bob')
	elif n % 2 == 0:
		print('Alice')
	elif n % 2 == 1:
		print('Bob')


def albob(n):
	return n & n - 1 == 0
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('Alice')
	elif n == 2:
		print('Bob')
	elif albob(n) or albob(n + 1):
		print('Alice')
	elif albob(n + 2):
		print('Bob')
	elif n % 2 == 0:
		print('Alice')
	elif n % 2 == 1:
		print('Bob')


import math

def solve(n):
	if n == 0:
		return 0
	elif n & 1:
		return 1 ^ solve(n - 1)
	elif n % 4 != 0:
		return 1 ^ solve(n // 2)
	return 1
try:
	for _ in range(int(input())):
		n = int(input())
		fn = solve(n)
		if fn:
			print('Alice')
		else:
			print('Bob')
except:
	pass


try:

	def nextPowerOf2(n):
		count = 0
		if n and (not n & n - 1):
			return n
		while n != 0:
			n >>= 1
			count += 1
		return 1 << count
	for t in range(int(input())):
		N = int(input())
		if N == 1:
			print('Alice')
		elif N == 2:
			print('Bob')
		elif N == 3:
			print('Alice')
		elif N == 4:
			print('Alice')
		else:
			temp = nextPowerOf2(N) - N
			if temp <= 3:
				if temp == 0 or temp == 1:
					print('Alice')
				elif temp == 2 or temp == 3:
					print('Bob')
			elif N % 2 == 0:
				print('Alice')
			else:
				print('Bob')
except:
	pass


def recur(n):
	if n == 0:
		return 0
	if n % 2 != 0:
		return not recur(n - 1)
	if n % 4 != 0:
		return not recur(n // 2)
	return 1
for i in range(int(input())):
	n = int(input())
	cnt = recur(n)
	print('Alice' if cnt != 0 else 'Bob')


for i in range(int(input())):
	n = int(input())
	m = 0
	while n:
		if n % 4 == 0:
			m += 1
			break
		if n % 2 == 0 and n % 4 != 0:
			n //= 2
			m += 1
		else:
			n -= 1
			m += 1
	if m % 2 == 1:
		print('Alice')
	else:
		print('Bob')


def solve():

	def win(n):
		if n == 0:
			return 1
		elif n & 1:
			return not win(n - 1)
		elif n % 4:
			return not win(n // 2)
		return 0
	n = int(input())
	if win(n) == 0:
		return 'Alice'
	return 'Bob'
t = int(input())
while t:
	print(solve())
	t -= 1


def solve(n):
	if n == 1:
		return 'Alice'
	if n == 2:
		return 'Bob'
	if n % 2 != 0:
		if n & n + 1 == 0:
			return 'Alice'
		else:
			return 'Bob'
	if n + 2 & n + 1 == 0:
		return 'Bob'
	else:
		return 'Alice'
for _ in range(int(input())):
	n = int(input())
	print(solve(n))


def po(n):
	if n != 0 and n & n - 1 == 0:
		return True
	else:
		return False
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 2:
		print('Bob')
	elif n == 1:
		print('Alice')
	elif n % 2 == 0:
		if po(n + 2) == True:
			print('Bob')
		else:
			print('Alice')
	elif n % 2 != 0:
		if po(n + 1) == True:
			print('Alice')
		else:
			print('Bob')


def f(n):
	if n == 0:
		return False
	if n % 2 == 1:
		return not f(n - 1)
	elif n % 4 != 0:
		return not f(n // 2)
	return True
for i in range(int(input())):
	n = int(input())
	ans = f(n)
	if ans:
		print('Alice')
	else:
		print('Bob')


def win(n):
	if n == 0:
		return False
	if n % 2 != 0:
		return not win(n - 1)
	elif n % 4 != 0:
		return not win(n // 2)
	return True

def main():
	tc = int(input())
	while tc > 0:
		n = int(input())
		if win(n):
			print('Alice')
		else:
			print('Bob')
		tc -= 1
main()


def func5(n):
	if n == 0:
		return 0
	elif n % 2 == 1:
		ans = func5(n - 1)
		if ans == 0:
			return 1
		else:
			return 0
	elif n % 4 == 0:
		return 1
	elif n % 2 == 0:
		ans = func5(n // 2)
		if ans == 0:
			return 1
		else:
			return 0
t = int(input())
for i in range(t):
	m = int(input())
	ans = func5(m)
	if ans == 1:
		print('Alice')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	count = 1
	while True:
		if n % 2 != 0:
			n -= 1
			if n != 0:
				count += 1
		elif n % 4 == 0:
			break
		else:
			count += 1
			n = n // 2
	if count % 2 != 0:
		print('Alice')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())

	def w(n):
		if not n:
			return 0
		if n & 1:
			return not w(n - 1)
		if n % 4:
			return not w(n // 2)
		return 1
	print('Alice' if w(n) else 'Bob')


def memoize(func):
	mem = {}

	def memoizer(*args, **kwargs):
		key = str(args) + str(kwargs)
		if key not in mem:
			mem[key] = func(*args, **kwargs)
		return mem[key]
	return memoizer

def inIntList():
	return [int(x) for x in input().split()]

def inInt():
	return int(input())

def outList(lst):
	for data in lst:
		print(data)

def solveA():
	result = ['Too Early', 'Too Late', 'Take second dose now']
	for _ in range(inInt()):
		(D, L, R) = inIntList()
		if D > R:
			ans.append(result[1])
		elif D < L:
			ans.append(result[0])
		else:
			ans.append(result[2])

def solveB():
	for _ in range(inInt()):
		(N, A, B, C) = inIntList()
		ans.append('YES' if N <= min([A + C, B]) else 'NO')

def solveC():
	str_ = [str(i + 1) for i in range(10 ** 5)]
	for _ in range(inInt()):
		N = inInt()
		if N % 4:
			ans.append('NO')
		else:
			ans.append('YES')
			ans.append(' '.join((a for a in str_[:N][:N // 4] + str_[:N][-N // 4:])))
			ans.append(' '.join((b for b in str_[:N][N // 4:-N // 4])))

def solveD():
	d = [0, 2, 1]
	for _ in range(inInt()):
		(L, R) = inIntList()
		ans.append(1 + (R - L - d[L % 3]) // 3)

def solveE():

	@memoize
	def recursive(n):
		if n == 0:
			return False
		elif n % 2:
			return not recursive(n - 1)
		elif n % 4 == 0:
			return True
		alice_win = False
		i = 2
		while n % i == 0:
			if not recursive(n // i):
				alice_win = True
				break
			i *= 2
		return alice_win
	result = ['Bob', 'Alice']
	for _ in range(inInt()):
		N = inInt()
		ans.append(result[recursive(N)])
ans = []
solveE()
outList(ans)


def win(n):
	if n == 0:
		return 0
	if n & 1:
		return not win(n - 1)
	if n % 4 != 0:
		return not win(n // 2)
	return 1
T = int(input())
for i in range(T):
	n = int(input())
	if win(n):
		print('Alice')
	else:
		print('Bob')


m = int(input())
for i in range(m):
	n = int(input())

	def win(n):
		if n == 0:
			return 0
		elif n % 2 != 0:
			return 1 - win(n - 1)
		elif n % 4 != 0:
			return 1 - win(n // 2)
		else:
			return 1
	if win(n) == 1:
		print('Alice')
	else:
		print('Bob')


def solve(n):
	if n == 0:
		return 0
	elif n % 2 != 0:
		return not solve(n - 1)
	elif n % 4 != 0:
		return not solve(n // 2)
	return 1
t = int(input())
for _ in range(t):
	n = int(input())
	flag = solve(n)
	if flag == 0:
		print('Bob')
	else:
		print('Alice')


for _ in range(int(input())):
	n = int(input())
	msZero = -1
	lsb = n & 1
	i = 0
	while n != 0:
		if n & 1 == 0:
			msZero = i
		n >>= 1
		i += 1
	if msZero == -1:
		print('Alice')
	elif msZero == 0:
		print('Bob')
	elif lsb == 1:
		print('Bob')
	else:
		print('Alice')


for _ in range(int(input())):
	a = int(input())
	b = 0
	while a:
		b += 1
		if a % 4 == 0:
			break
		elif a % 2 == 0:
			a //= 2
		else:
			a -= 1
	print('Alice' if b % 2 else 'Bob')


NUM = int(input())
ans = []
for _ in range(NUM):
	a = int(input())
	b = 0
	while a != 0:
		b += 1
		if a % 4 == 0:
			break
		elif a % 2 == 0:
			a //= 2
		else:
			a -= 1
	if b % 2 == 1:
		ans.append('Alice')
	else:
		ans.append('Bob')
for i in ans:
	print(i)


def pow(n):
	if n != 0 and n & n - 1 == 0:
		return True
	else:
		return False
for _ in range(int(input())):
	N = int(input())
	if N == 2:
		print('Bob')
	elif N == 1:
		print('Alice')
	elif N % 2 == 0:
		if pow(N + 2) == True:
			print('Bob')
		else:
			print('Alice')
	elif pow(N + 1) == True:
		print('Alice')
	else:
		print('Bob')


def whoWon(n):
	if n == 1 or n % 4 == 0:
		return True
	if n % 2 == 0:
		a = whoWon(n // 2)
	else:
		a = whoWon(n - 1)
	if a == True:
		return False
	else:
		return True
for i in range(int(input())):
	n = int(input())
	if whoWon(n):
		print('Alice')
	else:
		print('Bob')


def recur(n):
	if n == 0:
		return False
	if n & 1:
		return not recur(n - 1)
	if n % 4 != 0:
		return not recur(n // 2)
	return True
t = int(input())
for _ in range(t):
	n = int(input())
	if recur(n):
		print('Alice')
	else:
		print('Bob')


def solveFunc(n):
	if n == 0:
		return False
	a1 = bin(n).replace('0b', '')
	a1 = int(a1)
	if a1 & 1:
		return solveFunc(n - 1) == False
	if n % 4 != 0:
		return solveFunc(n // 2) == False
	return True
testcases = int(input())
while testcases:
	n = int(input())
	if solveFunc(n):
		print('Alice')
	else:
		print('Bob')
	testcases -= 1


import sys
for _ in range(int(input())):
	n = int(input())
	i = 1
	k = 0
	while i <= n and k == 0:
		if n % 2 != 0:
			j = 0
			while j <= n and k == 0:
				if n == 2 * j + 1:
					print('Alice')
					k = 1
					break
				j = 2 * j + 1
			if k == 0:
				print('Bob')
				k = 1
				break
		else:
			j = 0
			while j <= n and k == 0:
				if n == (2 * j + 1) * 2:
					print('Bob')
					k = 1
					break
				j = 2 * j + 1
			if k == 0:
				print('Alice')
				k = 1
				break


def win(n):
	if n == 0:
		return 0
	elif n % 2 != 0:
		return not win(n - 1)
	elif n % 4 != 0:
		return not win(n // 2)
	return 1
for _ in range(int(input())):
	num = int(input())
	if win(num):
		print('Alice')
	else:
		print('Bob')


for _ in range(int(input())):
	n = int(input())
	x = 1
	flag = 0
	while n > 0:
		if n % 2 != 0:
			n -= 1
		elif n % 4 == 0:
			flag = 1
		else:
			n = n // 2
		if x == 1:
			x = 0
		else:
			x = 1
		if flag:
			break
	if x == 0:
		print('Alice')
	else:
		print('Bob')


try:
	T = int(input())
	for z in range(T):
		N = int(input())
		x = -1
		fl = 0
		while N > 0:
			if N % 2 == 1:
				N -= 1
			elif N % 4 == 0:
				fl = 1
			else:
				N //= 2
			if x == -1 or x == 0:
				x = 1
			else:
				x = 0
			if fl == 1:
				break
		if x == 1:
			print('Alice')
		else:
			print('Bob')
except:
	pass


for _ in range(int(input())):
	n = int(input())
	if n & 1:
		n -= 1
		flag = 0
		while n > 0:
			if n & 1:
				n -= 1
			count = 0
			while n > 0 and n % 2 == 0:
				n //= 2
				count += 1
			if count > 1:
				flag = 1
				break
		if flag:
			print('Bob')
		else:
			print('Alice')
	else:
		flag = 0
		while n > 0:
			if n & 1:
				n -= 1
			count = 0
			while n > 0 and n % 2 == 0:
				n //= 2
				count += 1
			if count > 1:
				flag = 1
				break
		if flag:
			print('Alice')
		else:
			print('Bob')


from functools import lru_cache
cases = int(input())
for _ in range(cases):
	n = int(input())

	@lru_cache(None)
	def firstwin(n):
		if n == 1:
			return 1
		if n == 2:
			return 0
		if n % 2 != 0:
			return 1 - firstwin(n - 1)
		else:
			temp = n
			cnt = 0
			while temp % 2 == 0:
				cnt += 1
				temp //= 2
			if cnt == 1:
				return 1 - firstwin(temp)
			else:
				return 1
	if firstwin(n):
		print('Alice')
	else:
		print('Bob')


from functools import lru_cache

@lru_cache(None)
def helper(i):
	if i == 1:
		return True
	if i == 2:
		return False
	if i % 2 == 0:
		if i // 2 % 2 == 0:
			return True
		else:
			return not helper(i // 2)
	if i % 2 == 1:
		return not helper(i - 1)
t = int(input())
for _ in range(t):
	n = int(input())
	if helper(n):
		print('Alice')
	else:
		print('Bob')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	count = 0
	while n != 0:
		count += 1
		if n % 2 != 0:
			n -= 1
		elif n % 4 != 0:
			n //= 2
		else:
			break
	if count % 2 == 0:
		print('Bob')
	else:
		print('Alice')


T = int(input())
for t in range(T):
	N = int(input())
	if N & 1:
		if '0' in bin(N)[2:]:
			print('Bob')
		else:
			print('Alice')
	elif '0' in bin(N >> 1)[2:]:
		print('Alice')
	else:
		print('Bob')


import math, os, io, heapq
from sys import stdin, stdout
from collections import Counter, deque, defaultdict
from itertools import product
import bisect

def getList(method=int):
	return list(map(method, input().split()))

def getInt():
	return int(input())

def solve():
	n = getInt()
	print('Alice' if check(n) else 'Bob')

def check(n):
	if n == 1 or n % 4 == 0:
		return True
	if n % 2:
		return not check(n - 1)
	return not check(n // 2)
for _ in range(getInt()):
	solve()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('Alice')
	elif n == 2:
		print('Bob')
	elif n % 2 == 0:
		if n + 2 & n + 1 == 0:
			print('Bob')
		else:
			print('Alice')
	elif n + 1 & n == 0:
		print('Alice')
	else:
		print('Bob')


def solve(n):
	if n == 0:
		return False
	if n & 1:
		return not solve(n - 1)
	if n % 4 != 0:
		return not solve(n // 2)
	return True
t = int(input())
for i in range(t):
	n = int(input())
	if solve(n):
		print('Alice')
	else:
		print('Bob')


def solve(n, player):
	if n == 1:
		return player
	if n % 4 == 0:
		return player
	if n & 1 == 1:
		return solve(n - 1, abs(1 - player))
	return solve(n // 2, abs(1 - player))
t = int(input())
for _ in range(t):
	n = int(input())
	x = solve(n, 0)
	if x == 0:
		print('Alice')
	else:
		print('Bob')


import sys
input = sys.stdin.readline

def I():
	return input().strip()

def II():
	return int(input().strip())

def LI():
	return [*map(int, input().strip().split())]
import copy, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter, OrderedDict
from itertools import permutations, chain, combinations, groupby
from operator import itemgetter
from types import GeneratorType
from typing import Iterable, TypeVar, Union
for _ in range(II()):
	n = II()
	if n == 1:
		print('Alice')
	elif n == 2:
		print('Bob')
	elif n == 3:
		print('Alice')
	else:
		cnt = 0
		adv = 0
		fst = False
		srt = True
		while n:
			if n % 2 == 0:
				if n % 4 == 0:
					if not fst:
						fst = True
						if cnt % 2 == 1:
							srt = False
					adv += 1
				while n % 2 == 0:
					n //= 2
					cnt += 1
			else:
				n -= 1
				cnt += 1
		if adv:
			if srt:
				print('Alice')
			else:
				print('Bob')
		elif cnt % 2 == 1:
			print('Alice')
		else:
			print('Bob')


T = int(input())
import math
from decimal import Decimal as d
for i in range(T):
	n = int(input())
	c = 0
	while n != 0:
		if n % 2 != 0:
			n = n - 1
			c += 1
		elif n % 4 == 0:
			c += 1
			break
		else:
			n = int(d(n) / d(2))
			c += 1
	if c % 2 == 0:
		print('Bob')
	else:
		print('Alice')


inf = float('inf')
import sys
import pprint
import logging
from logging import getLogger
import array

def input():
	return sys.stdin.readline().rstrip('\r\n')

def maps():
	return [int(i) for i in input().split()]
logging.basicConfig(format='%(message)s', level=logging.WARNING)
logger = getLogger(__name__)
logger.setLevel(logging.INFO)

def debug(msg, *args):
	logger.info(f'{msg}={pprint.pformat(args)}')

def func():
	(n,) = maps()
	turn = 0
	while n > 0:
		if n % 2:
			n -= 1
		elif n % 4:
			n //= 2
		elif n % 4 == 0:
			turn ^= 1
			break
		turn ^= 1
	print('Alice' if turn else 'Bob')
(t,) = maps()
while t:
	t -= 1
	func()


def solve(n):
	if n != 0 and n & n - 1 == 0:
		return True
	return False
for u in range(int(input())):
	n = int(input())
	if n == 1:
		print('Alice')
	elif n == 2:
		print('Bob')
	elif n % 2 == 0:
		if solve(n + 2):
			print('Bob')
		else:
			print('Alice')
	elif solve(n + 1):
		print('Alice')
	else:
		print('Bob')


opps = {'Alice': 'Bob', 'Bob': 'Alice'}
player = ['Alice', 'Bob']

def solve(n, player='Alice'):
	if n == 0:
		return 0
	if n % 2 != 0:
		return not solve(n - 1)
	if n % 4 != 0:
		return not solve(n // 2)
	return 1
for _ in range(int(input())):
	n = int(input())
	if solve(n):
		print('Alice')
	else:
		print('Bob')


tc = int(input())
for _ in range(tc):
	n = int(input())
	turn = True
	while n > 0:
		if turn:
			turn = False
		else:
			turn = True
		if n % 4 == 0:
			break
		if n % 2 == 1:
			n -= 1
			continue
		if n % 2 == 0:
			n //= 2
			continue
	if turn:
		print('Bob')
	else:
		print('Alice')


def check(n):
	if n != 0 and n & n - 1 == 0:
		return True
	else:
		return False

def solve():
	n = int(input())
	i = 2
	if n == 2:
		print('Bob')
		return
	if n == 1:
		print('Alice')
		return
	if n % 2 == 0:
		if check(n + 2):
			print('Bob')
		else:
			print('Alice')
		return
	if n % 2 != 0:
		if check(n + 1):
			print('Alice')
		else:
			print('Bob')
		return
t = int(input())
while t:
	solve()
	t -= 1


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print('Alice')
	elif n % 2 != 0:
		n = n - 1
		count = 0
		while n > 0:
			n -= 1
			count1 = 0
			while n % 2 == 0:
				n = n // 2
				count1 += 1
				n = n - 1
				if count1 >= 2:
					count += 1
		if count >= 2:
			print('Bob')
		elif count == 0:
			print('Alice')
		else:
			print('Bob')
	else:
		count = 0
		while n > 0:
			n -= 1
			count1 = 0
			while n % 2 == 0:
				n = n // 2
				count1 += 1
				n = n - 1
				if count1 >= 2:
					count += 1
		if count >= 2:
			print('Alice')
		elif count == 0:
			print('Bob')
		else:
			print('Alice')


def numCon(a, n):
	s = ''
	while a != 0:
		s = str(a % n) + s
		a = a // n
	l1 = list(s)
	return l1
for _ in range(int(input())):
	n = int(input())
	l = numCon(n, 2)
	if l[-1] == '1':
		if l.count('1') == len(l):
			print('Alice')
		else:
			print('Bob')
	elif l.count('1') == len(l) - 1:
		print('Bob')
	else:
		print('Alice')


import math
import sys

def highestPowerof2(n):
	if n < 1:
		return 0
	res = 1
	for i in range(8 * sys.getsizeof(n)):
		curr = 1 << i
		if curr > n:
			break
		res = curr
	return res
for _ in range(int(input())):
	n = int(input())
	flag = 0
	a = [0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0]
	if n <= 20:
		if a[n - 1] == 0:
			print('Alice')
			continue
		else:
			print('Bob')
			continue
	a1 = highestPowerof2(n)
	a2 = 2 * a1
	if n == a1 or n == a2:
		print('Alice')
		continue
	if n == a2 - 2:
		print('Bob')
		continue
	if n == a2 - 1:
		print('Alice')
		continue
	l = n - a1
	if l % 2 == 0:
		print('Alice')
	else:
		print('Bob')


def pow(n):
	if n != 0 and n & n - 1 == 0:
		return True
	else:
		return False
T = int(input())
while T:
	N = int(input())
	if N == 2:
		print('Bob')
	elif N == 1:
		print('Alice')
	elif N % 2 == 0:
		if pow(N + 2) == True:
			print('Bob')
		else:
			print('Alice')
	elif pow(N + 1) == True:
		print('Alice')
	else:
		print('Bob')
	T -= 1


def pow(x):
	return x and (not x & x - 1)
import math
t = int(input())
for a in range(t):
	n = int(input())

	def solve(n):
		if n == 1:
			return 'Alice'
		if n == 2:
			return 'Bob'
		if n % 2 == 0:
			if pow(n + 2):
				return 'Bob'
			else:
				return 'Alice'
		if n % 2 != 0:
			if pow(n + 1):
				return 'Alice'
			else:
				return 'Bob'
	print(solve(n))


t = int(input())
for i in range(t):
	p = int(input())
	if p == 1:
		print('Alice')
	elif p == 2:
		print('Bob')
	elif p % 2 != 0:
		if p + 1 != 0 and p + 1 & p == 0:
			print('Alice')
		else:
			print('Bob')
	elif p % 2 == 0:
		if p + 2 != 0 and p + 2 & p + 1 == 0:
			print('Bob')
		else:
			print('Alice')


def decimalToBinary(n):
	return bin(n).replace('0b', '')
t = int(input())
for _ in range(t):
	n = int(input())
	s = decimalToBinary(n)[::-1]
	i = 0
	while s[i] == '0':
		i += 1
	if i > 1:
		print('Alice')
	else:
		if i == 0:
			f = 1
		else:
			f = 0
		for i in range(i, len(s)):
			if s[i] == '0':
				if f == 1:
					f = 0
					break
				else:
					f = 1
					break
		if f == 1:
			print('Alice')
		else:
			print('Bob')


t = int(input())
x = []
for z in range(t):
	n = int(input())
	if n == 1:
		print('Alice')
		x.append('W')
	elif n == 2:
		print('Bob')
		x.append('L')
	elif n % 2 != 0:
		if n + 1 & n == 0:
			print('Alice')
			x.append('W')
		else:
			print('Bob')
			x.append('L')
	elif n & n - 1 == 0:
		print('Alice')
		x.append('W')
	else:
		c = 0
		h = n
		while h % 2 == 0:
			h = h // 2
			c += 1
		if h + 1 & h == 0:
			if c >= 2:
				print('Alice')
				x.append('W')
			else:
				print('Bob')
				x.append('L')
		else:
			print('Alice')


def hello():
	t = int(input())
	for i in range(t):
		n = int(input())
		if n == 1:
			print('Alice')
		elif n == 2:
			print('Bob')
		elif n % 2 == 0:
			if helper(n + 2) == True:
				print('Bob')
			else:
				print('Alice')
		elif helper(n + 1) == True:
			print('Alice')
		else:
			print('Bob')

def helper(x):
	if x != 0 and x & x - 1 == 0:
		return True
	else:
		return False
hello()


from math import log, ceil

def solve(n):
	if n == 1:
		return 'Alice'
	if n == 2:
		return 'Bob'
	if n == 3:
		return 'Alice'
	if n == 4:
		return 'Alice'
	k = 2
	while k < n:
		k <<= 1
	c = k
	if n == c or n == c - 1:
		return 'Alice'
	if n == c - 2 or n == c - 3:
		return 'Bob'
	if n % 2 == 0:
		return 'Alice'
	return 'Bob'
t = int(input().strip())
inputs = []
for _ in range(t):
	n = int(input().strip())
	inputs.append(n)
for n in inputs:
	print(solve(n))


def bol(n):
	if n != 0 and n & n - 1 == 0:
		return 1
	else:
		return 0
t = int(input())
for _ in range(t):
	n = int(input())
	t = 0
	if n == 2:
		print('Bob')
	elif n == 1:
		print('Alice')
	elif n % 2 == 0:
		if bol(n + 2) == 1:
			print('Bob')
		else:
			print('Alice')
	elif n % 2 != 0:
		if bol(n + 1) == 1:
			print('Alice')
		else:
			print('Bob')


def power(n):
	if n == 0:
		return False
	while n != 1:
		if n % 2 != 0:
			return False
		n = n // 2
	return True
try:
	for T in range(int(input())):
		N = int(input())
		if N == 2:
			print('Bob')
		elif N == 1:
			print('Alice')
		elif N % 2 == 0:
			if power(N + 2) == True:
				print('Bob')
			else:
				print('Alice')
		elif N % 2 != 0:
			if power(N + 1) == True:
				print('Alice')
			else:
				print('Bob')
except:
	pass


import sys
for _ in range(int(sys.stdin.readline())):
	n = int(sys.stdin.readline())
	f = 0
	x = n
	if n % 2:
		n -= 1
		c = 0
		while n != 0:
			s = 0
			while n % 2 == 0:
				s += 1
				n = n // 2
			n -= 1
			if s > 1:
				c += 1
		if c > 1:
			f = 0
		elif c % 2 == 0:
			f = 1
		else:
			f = 0
	else:
		c = 0
		while n != 0:
			s = 0
			while n % 2 == 0:
				s += 1
				n = n // 2
			n -= 1
			if s > 1:
				c += 1
		if c > 1:
			f = 1
		elif c % 2 == 0:
			f = 0
		else:
			f = 1
	if f == 1:
		sys.stdout.write('Alice\n')
	else:
		sys.stdout.write('Bob\n')


def pow(n):
	if n != 0 and n & n - 1 == 0:
		return True
	else:
		return False

def solve():
	n = int(input())
	i = 2
	if n == 2:
		print('Bob')
		return
	if n == 1:
		print('Alice')
		return
	if n % 2 == 0:
		if pow(n + 2) == True:
			print('Bob')
		else:
			print('Alice')
		return
	if n % 2 != 0:
		if pow(n + 1) == True:
			print('Alice')
		else:
			print('Bob')
		return
t = int(input())
for i in range(t):
	solve()


def pow(N):
	if N != 0 and N & N - 1 == 0:
		return True
	return False

def func(N):
	if N == 2:
		return 'Bob'
	if N == 1:
		return 'Alice'
	if N % 2 == 0:
		if pow(N + 2):
			return 'Bob'
		return 'Alice'
	else:
		if pow(N + 1):
			return 'Alice'
		return 'Bob'
for t in range(int(input())):
	N = int(input())
	print(func(N))


def p(n):
	if n != 0 and n & n - 1 == 0:
		return True
	else:
		return False
for _ in range(int(input())):
	n = int(input())
	i = 2
	if n == 1:
		print('Alice')
		continue
	if n == 2:
		print('Bob')
		continue
	if n % 2 == 0:
		if p(n + 2) == True:
			print('Bob')
		else:
			print('Alice')
	elif p(n + 1) == True:
		print('Alice')
	else:
		print('Bob')


test_cases = int(input())
powers = {4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4294967296, 8589934592, 17179869184, 34359738368, 68719476736, 137438953472, 274877906944, 549755813888, 1099511627776, 2199023255552, 4398046511104, 8796093022208, 17592186044416, 35184372088832, 70368744177664, 140737488355328, 281474976710656, 562949953421312, 1125899906842624, 2251799813685248, 4503599627370496, 9007199254740992, 18014398509481984, 36028797018963968, 72057594037927936, 144115188075855872, 288230376151711744, 576460752303423488, 1152921504606846976}
for test in range(test_cases):
	A = int(input())
	if A == 1:
		print('Alice')
	elif A == 2:
		print('Bob')
	elif A % 2 == 0:
		if {A + 2}.intersection(powers):
			print('Bob')
		else:
			print('Alice')
	elif {A - 1 + 2}.intersection(powers):
		print('Alice')
	else:
		print('Bob')


def func(val):
	return True if val & val - 1 == 0 else False
test = int(input())
for t in range(test):
	n = int(input())
	if n == 1:
		print('Alice')
	elif n == 2:
		print('Bob')
	elif n % 2 != 0:
		print('Alice' if func(n + 1) else 'Bob')
	else:
		print('Bob' if func(n + 2) else 'Alice')


def apow(x):
	if x != 0 and x & x - 1 == 0:
		return True
	return False
for tc in range(int(input())):
	n = int(input())
	if n == 1:
		print('Alice')
	elif n == 2:
		print('Bob')
	elif n % 2 == 0:
		if apow(n + 2) == True:
			print('Bob')
		else:
			print('Alice')
	elif n % 2 != 0:
		if apow(n + 1) == True:
			print('Alice')
		else:
			print('Bob')


import math
import random as rd
import bisect
import collections

def combination(n, r):
	return math.comb(n, r)

def listing():
	return list(map(int, input().split()))

def intp():
	return int(input())

def inp():
	return input()

def inpspl():
	return input().split()

def mapping():
	return map(int, input().split(' '))

def sqrt(n):
	return math.sqrt(n)

def gcd(a, b):
	return math.gcd(a, b)

def lcm(a, b):
	return a * b // gcd(a, b)

def p(s):
	print(f'{s}')

def lsetl(lst):
	return list(set(lst))

def nCr(n, r):
	f = math.factorial
	return f(n) // f(r) // f(abs(n - r))

def frequencyofall(lst):
	return dict(collections.Counter(lst))

def ispowerof2(n):
	return n & n - 1 == 0

def ispowerof3(n):
	return math.log10(n) / math.log10(3) % 1 == 0

def dictionarysort(d):
	return collections.OrderedDict(sorted(d.items()))

def bintoint(s):
	return int(s, 2)

def po(n):
	if n != 0 and n & n - 1 == 0:
		return True
	else:
		return False

def solve():
	for _ in range(intp()):
		n = intp()
		i = 2
		if n == 2:
			p('Bob')
			continue
		if n == 1:
			p('Alice')
			continue
		if n % 2 == 0:
			if po(n + 2) == True:
				p('Bob')
			else:
				p('Alice')
		elif po(n + 1) == True:
			p('Alice')
		else:
			p('Bob')
solve()


for _ in range(int(input())):
	n = int(input())

	def f(i):
		if i == 1:
			return True
		if i == 2:
			return False
		if i % 2:
			return i & i + 1 == 0
		return i + 1 & i + 2 != 0
	print('Alice' if f(n) else 'Bob')