import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ try (Scanner scanner = new Scanner(System.in)) { int g = scanner.nextInt(); int m = Integer.MIN_VALUE; int[] a = new int[g]; StringBuilder output = new StringBuilder(); // Collecting for (int i = 0; i < g; i++) { int n = scanner.nextInt(); if (m < n) { m = n; } a[i] = n; //output.append(willAliceWin(n) ? "Alice" : "Bob").append(System.lineSeparator()); } // Checking List allPrimes = getAllPrimeNumbersUpToN(m); int numberOfPrimesBefore; for (int j: a) { if (j != 1) { numberOfPrimesBefore = Collections.binarySearch(allPrimes, j); if (numberOfPrimesBefore >= 0) { output.append(numberOfPrimesBefore%2 != 0 ? "Alice" : "Bob").append(System.lineSeparator()); } else { numberOfPrimesBefore = -numberOfPrimesBefore - 1; output.append(numberOfPrimesBefore%2 == 0 ? "Alice" : "Bob").append(System.lineSeparator()); } } else { output.append("Bob").append(System.lineSeparator()); } } // Printing System.out.println(output); } } static boolean willAliceWin(int n) { // corner cases if (n == 1) { return false; } if (n == 2) { return true; } if (n == 3) { return false; } boolean isAliceWin = false; for (int i = 5; i <= n; i+=2) { if (isPrime(i)) { isAliceWin = !isAliceWin; } } return isAliceWin; } static boolean isPrime(int n) { switch (n) { case 1: { return false; } case 2: { return true; } default: { if (n%2 == 0) { return false; } else { double sqrtN = Math.sqrt(n); for (int p = 3; p <= sqrtN; p += 2) { if (n%p == 0) { return false; } } } } } return true; } static List getAllPrimeNumbersUpToN(int n) { List allPrimes = new ArrayList<>(); if (n == 1) return allPrimes; if (n == 2) { allPrimes.add(n); return allPrimes; } for (int i = 3; i <= n; i += 2) { // Checking boolean isItPrime = true; for (int p: allPrimes) { if (i%p == 0) { isItPrime = false; break; } } // Adding if needed if (isItPrime) { allPrimes.add(i); } } return allPrimes; } }