import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Scanner; /** * https://www.hackerrank.com/contests/101hack44/challenges/alice-and-bobs-silly-game */ public class AliceAndBobSillyGame { private static final int MAX = 30; public static void main(String[] args) throws Exception { Scanner scanner = new Scanner(System.in); //Scanner scanner = new Scanner(new File("aliceAndBobSillyGame")); int g = scanner.nextInt(); for (int i = 0; i < g; i++) { int n = scanner.nextInt(); System.out.println(new AliceAndBobSillyGame(n).win() ? "Alice" : "Bob"); } scanner.close(); } int n; public AliceAndBobSillyGame(int n) { this.n = n; } boolean[] composite; public boolean win() { return (sieveEratosthenes(n) % 2) == 1; } private int sieveEratosthenes(int n) { int primes = 0; composite = new boolean[n+1]; for (int i = 2; i <= n; i++) { if (! composite[i]) { primes++; for (int j = 2*i; j <= n; j += i) { composite[j] = true; } } } return primes; } }