import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.InputMismatchException; public class Hack44_2{ void solve() { int[] primes = primes(1000000); int G = ni(); while(G-->0) { int n = ni(); if(n==1) { System.out.println("Bob"); continue; } n++; for(int i=0;;i++) { if(primes[i]>=n) { System.out.println((i-1)%2==0 ? "Alice":"Bob"); break; } } } } static int[] primes(int n) // primes until n { int[] primes = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71, 73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151, 157,163,167,173,179,181,191,193,197,199,211,223,227,229,233, 239,241,251,257,263,269,271,277,281,283,293,307,311,313,317, 331,337,347,349,353,359,367,373,379,383,389,397,401,409,419, 421,431,433,439,443,449,457,461,463,467,479,487,491,499,503, 509,521,523,541,547,557,563,569,571,577,587,593,599,601,607, 613,617,619,631,641,643,647,653,659,661,673,677,683,691,701, 709,719,727,733,739,743,751,757,761,769,773,787,797,809,811, 821,823,827,829,839,853,857,859,863,877,881,883,887,907,911, 919,929,937,941,947,953,967,971,977,983,991,997}; if(n<1009) { for(int i=0;i<168;i++) if(primes[i]>n) return Arrays.copyOf(primes,i); return primes; } int len = (int)((n*1.1) / (Math.log(n) -1)); primes = Arrays.copyOf(primes, len); int cur = 168; int limP = (int)Math.sqrt(n)+1; int limI = 167; for(int i=0;i<168;i++) if(primes[i]>limP) { limI = i; break; } OUTER: for(int p=1009;p<=n;p+=2) { for(int i=1;i<=limI;i++) if(p%primes[i]==0) continue OUTER; primes[cur++] = p; } return Arrays.copyOf(primes,cur); } public static void main(String[] args){new Hack44_2().solve();} private byte[] bufferArray = new byte[1024]; private int bufLength = 0; private int bufCurrent = 0; InputStream inputStream = System.in; int nextByte() { if(bufLength==-1) throw new InputMismatchException(); if(bufCurrent>=bufLength) { bufCurrent = 0; try {bufLength = inputStream.read(bufferArray);} catch(IOException e) { throw new InputMismatchException();} if(bufLength<=0) return -1; } return bufferArray[bufCurrent++]; } boolean isSpaceChar(int x) {return (x<33 || x>126);} boolean isDigit(int x) {return (x>='0' && x<='9');} int nextNonSpace() { int x; while((x=nextByte())!=-1 && isSpaceChar(x)); return x; } int ni() { int ans = 0; int sign = 1; int x = nextNonSpace(); if(x=='-') { sign = -1; x = nextByte(); } while(!isSpaceChar(x)) { if(isDigit(x)) { ans = ans*10 + x -'0'; x = nextByte(); } else throw new InputMismatchException(); } return sign*ans; } long nl() { long ans = 0; long sign = 1; int x = nextNonSpace(); if(x=='-') { sign = -1; x = nextByte(); } while(!isSpaceChar(x)) { if(isDigit(x)) { ans = ans*10 + x -'0'; x = nextByte(); } else throw new InputMismatchException(); } return sign*ans; } String ns() { StringBuilder sb = new StringBuilder(); int x = nextNonSpace(); while(!isSpaceChar(x)) { sb.append((char)x); x = nextByte(); } return sb.toString(); } String nL() { StringBuilder sb = new StringBuilder(); int x = nextNonSpace(); while(x==32 || !isSpaceChar(x)) { sb.append((char)x); x = nextByte(); } return sb.toString(); } char nc() { return (char)nextNonSpace();} double nd() { return (double)Double.parseDouble(ns()); } char[] ca() { return ns().toCharArray();} char[] ca(int n) { char[] ans = new char[n]; int p =0; int x = nextNonSpace(); while(p