/* Solved By : Kazi Mahbubur Rahman (cryptic.coder) Time : Rank : Complexity: */ #define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(i, L, U) for(int i=(int)L; i<=(int)U; i++) #define FORD(i, U, L) for(int i=(int)U; i>=(int)L; i--) #define READ(x) freopen(x, "r", stdin) #define WRITE(x) freopen(x, "w", stdout) #define ff first #define ss second #define PQ priority_queue #define PB push_back #define SZ size() #define EPS 1e-9 #define SQR(x) ((x)*(x)) #define INF 2000000000 #define TO_DEG 57.29577951 #define PI 2*acos(0.0) #define ALL_BITS ((1 << 31) - 1) #define NEG_BITS(mask) (mask ^= ALL_BITS) #define TEST_BIT(mask, i) (mask & (1 << i)) #define ON_BIT(mask, i) (mask |= (1 << i)) #define OFF_BIT(mask, i) (mask &= NEG_BITS(1 << i)) #define IS_POWER_TWO(x) (x && !(x & (x-1))) #define OFF_RIGHTMOST_SET_BIT(x) (x & (x-1)) typedef long long LL; typedef unsigned long long ULL; typedef pair PII; typedef pair PDD; typedef vector VB; typedef vector VI; typedef vector VD; typedef vector VC; typedef vector VS; typedef map MII; typedef map MCI; typedef map MSI; typedef vector > VVB; typedef vector > VVI; typedef vector > VVD; typedef vector > VVPII; int GCD(int a, int b) { while (b)b ^= a ^= b ^= a %= b; return a; } // UP, RIGHT, DOWN, LEFT, UPPER-RIGHT, LOWER-RIGHT, LOWER-LEFT, UPPER-LEFT int dx[8] = { -1, 0, 1, 0, -1, 1, 1, -1 }; int dy[8] = { 0, 1, 0,-1, 1, 1, -1, -1 }; // Represents all moves of a knight in a chessboard int dxKnightMove[8] = { -1, -2, -2, -1, 1, 2, 2, 1 }; int dyKnightMove[8] = { 2, 1, -1, -2, -2, -1, 1, 2 }; inline int src() { int ret; scanf("%d", &ret); return ret; } #define WHITE 0 #define GRAY 1 #define BLACK 2 #define MAX_PRIME 100007 bool flag[MAX_PRIME]; VI primes; int primeCount[MAX_PRIME]; int N, G; void sieve() { LL i = 2, j; while (i*i <= MAX_PRIME) { for (j = i*i; j <= MAX_PRIME; j += i) flag[j] = 1; while (flag[++i]); } primes.PB(2); for (i = 3; i < MAX_PRIME; i += 2) if (flag[i] == 0) primes.PB(i); } bool isPrime(LL n) { if (n == 0 || n == 1) return 0; if (n <= MAX_PRIME) return (!flag[n]); int root = sqrt((double)n); for (int i = 0; primes[i] <= root; i++) if (n % primes[i] == 0) return false; return true; } void DP() { primeCount[1] = 0; FOR(i, 2, MAX_PRIME) { if (isPrime(i)) primeCount[i] = primeCount[i - 1] + 1; else primeCount[i] = primeCount[i - 1]; } } int main() { //READ("input.txt"); //WRITE("output.txt"); int i, j, k; int TC, tc; double cl = clock(); sieve(); DP(); cin >> G; FOR(i, 1, G) { cin >> N; if (primeCount[N] & 1) cout << "Alice" << endl; else cout << "Bob" << endl; } cl = clock() - cl; fprintf(stderr, "Total Execution Time = %lf seconds\n", cl / CLOCKS_PER_SEC); return 0; }