#include #include using namespace std; int SieveOfEratosthenes(int n) { int count=0; bool prime[n+1]; memset(prime, true, sizeof(prime)); for (int p=2; p*p<=n; p++) { // If prime[p] is not changed, then it is a prime if (prime[p] == true) { // Update all multiples of p for (int i=p*2; i<=n; i += p) prime[i] = false; } } // Print all prime numbers for (int p=2; p<=n; p++) if (prime[p]) count++; return count; } int main() { int g; // int arr[100001]; // for(int i=0;i<100001;i++) // arr[i]=0; // for(int i=1;i<=n;i++) // { // int nop=0; // int counter=0; // for(int j=1;j<=i;j++) // { // if(i%j==0) // counter++; // } // if(counter==2) // nop++; // arr[i]=nop; // } cin>>g; while(g--) { int n; cin>>n; int count=SieveOfEratosthenes(n); if(count%2==0) cout<<"Bob\n"; else cout<<"Alice\n"; } }