#include #include #include #include #include #define LIMIT 100000 using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int gameloop = 0; int temp; cin >> gameloop; vector range; for(int i = 0; i < gameloop; ++i) { cin >> temp; range.push_back(temp); } int crosslimit = sqrt(LIMIT); bool sieve[LIMIT + 1] = { false }; sieve[1] = true; for(int i = 4; i <= LIMIT; i += 2) { sieve[i] = true; } for(int i = 3; i < crosslimit; i += 2) { if(!sieve[i]) { for(int j = i * i; j <= LIMIT; j += 2 * i) { sieve[j] = true; } } } int count = 0; for(int i = 0; i < gameloop; ++i) { int count = 0; for(int j = 2; j <= range[i]; ++j) { if(!sieve[j]) count ++; } if(range[i] == 1) { // special case cout << "Bob" << endl; } else if (count % 2 == 0) { // when even, Bob win cout << "Bob" << endl; } else { cout << "Alice" << endl; } } return 0; }