#include using namespace std; #define SZ(a) (int((a).size())) #define FOR(i,n) for(int _n=(n),i=0;i<_n;++i) #define FORI(i,a,b) for(int i=(a);i<=(b);++i) #define FORD(i,a,b) for(int i=(a);i>=(b);--i) #define FORSZ(i,c) FOR(i,SZ(c)) #define SET(t,x) memset((t),(x),sizeof(t)) #define FOREACH(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it) #define PRINT(x) cout<<#x<<"="<= 0 ? (a) : (-(a))) #define PB push_back #define MP make_pair #define EPS 1e-11 #define EPS2 1e-9 #define D_EQ(a,b) ((a)>((b)-EPS) && (a)<((b)+EPS)) #define D_LT(a,b) ((a)<((b)-EPS)) #define D_LTEQ(a,b) ((a)<((b)+EPS)) #define D_GT(a,b) ((a)>((b)+EPS)) #define D_GTEQ(a,b) ((a)>((b)-EPS)) #define INF 100000000 typedef long long ll; typedef pair PII; typedef vector VI; typedef vector VS; typedef vector VVI; template string i2s(T x) {ostringstream o; o << x; return o.str(); } templatevector split(const string& s){vector v;istringstream is(s);T t;while(is>>t)v.PB(t);return v;} //VS splitStr(const string& s, char delim='\0', bool keepEmpty=false){if(delim=='\0')return split(s);VS v;istringstream is(s);string t;while(getline(is,t,delim))if(keepEmpty || t!="")v.PB(t);return v;} VS splitStr(const string& s,const string& d="",bool keepEmpty=false){if(d.empty())return split(s);VS v;string t;FOR(i,SZ(s))if(d.find(s[i])!=string::npos){if(keepEmpty||!t.empty()){v.PB(t);t="";}}else t+=s[i];if(!t.empty())v.PB(t);return v;} void findPrimes_Sieve(bool isPrime[], int N) // sets the flag to true for all primes till N(including N). The isPrime[] array must be of atleast N+1 size. // uses "Sieve of Erastothenes" method { int i,j,k; memset(isPrime,1,(N+1)*sizeof(bool)); isPrime[0] = isPrime[1] = false; for(i=4;i<=N;i+=2) isPrime[i]=false; int sqrtN = (int)sqrt(N); for(i=3;i<=sqrtN;i+=2) if(isPrime[i]) for(j=i*i,k=2*i;j<=N;j+=k) isPrime[j]=false; return; } // Helper function to copy primes calculated using sieve to a list of primes. int initPrime(bool isPrime[], int N, int primes[]) // isPrime[] must be of atleast size N+1. // primes array must have a size equal to or greater than the no. of primes till and including N. // Beware of a common mistake: The size of primes[] is not bounded by sqrt(N). The larget prime factor is bounded by sqrt(N), but not the number of primes. { int i,k; findPrimes_Sieve(isPrime, N); // apply sieve method for(i=0,k=0;i<=N;i++) if(isPrime[i]) primes[k++] = i; return k; // The number of primes till N } bool isPrime[100000+1]; int primeCountTillN[100000+1]; int main() { std::ios::sync_with_stdio(false); int maxN=100000; findPrimes_Sieve(isPrime, maxN); primeCountTillN[0]=0; primeCountTillN[1]=0; FORI(i,2,maxN)if(isPrime[i])primeCountTillN[i]=1+primeCountTillN[i-1];else primeCountTillN[i]=primeCountTillN[i-1]; int g,n; cin>>g; while(g--) { cin>>n; if(primeCountTillN[n]%2==1)cout<<"Alice\n";else cout<<"Bob\n"; } return 0; }