#include #include #include #include using namespace std; bool isPrime[20001]; vector primes; bool turn(int n) { if (n == 1) { return false; } map factors; int x = n; for (int i = 0; primes[i] * primes[i] <= x; ++i) { while (x % primes[i] == 0) { ++factors[primes[i]]; x /= primes[i]; } } if (x > 1) { ++factors[x]; } for (map::const_iterator it = factors.begin(); it != factors.end(); ++it) { int divider = it->first; for (int power = 1; power <= it->second; ++power) { if (!turn(n / divider)) { return true; } divider *= it->first; } } return false; } int main() { fill(&isPrime[0], &isPrime[20000] + 1, true); isPrime[0] = false; isPrime[1] = false; for (int i = 2; i <= 20000; ++i) { if (isPrime[i]) { for (int k = i * 2; k <= 20000; k += i) { isPrime[k] = false; } } } for (int i = 0; i <= 20000; ++i) { if (isPrime[i]) { primes.push_back(i); } } int n; cin >> n; bool aliceWin = turn(n); cout << (aliceWin ? "Alice" : "Bob") << endl; return 0; }