#ifdef ONLINE_JUDGE #define NDEBUG #endif #if defined(__GNUC__) && !defined(__clang__) // #pragma GCC optimize("O3") // #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #pragma GCC optimize("unroll-loops") #endif #include using namespace std; #if __cplusplus >= 202002L namespace R = ranges; namespace V = views; #endif using i64 = long long; using u64 = unsigned long long; using f64 = double; using uz = size_t; using u32 = uint32_t; using itn = int; template using ve = vector; template using a2 = array; template using HashMap = unordered_map; template using HashSet = unordered_set; template > using PQ = std::priority_queue, C>; template > using miPQ = std::priority_queue, C>; #define mt make_tuple #define mp make_pair #ifdef LOCAL #include "debug_template.cpp" #else #define debug(...) #define debugArr(...) #endif // constexpr array dirs{-1, 0, 1, 0, -1}; // constexpr char nesw[4]{'N', 'E', 'S', 'W'}; // constexpr int M = 1e9 + 7; void cln() { cout << '\n'; } constexpr char ln = '\n'; array dp; int g(int n, ve> &cnt) { if (n == 1) { return 0; } int &memo = dp[n]; if (memo != -1) { return memo; } bitset<20> in(UINT_MAX); for (int i = 0; i < cnt.size(); ++i) { if (cnt[i][1] == 0) { continue; } cnt[i][1] -= 1; in.reset(g(n / cnt[i][0], cnt)); cnt[i][1] += 1; if (cnt[i][1] != 1) { cnt[i][1] -= 2; in.reset(g(n / (cnt[i][0] * cnt[i][0]), cnt)); cnt[i][1] += 2; } } return memo = in._Find_first(); } int f(int n) { int memo = dp[n]; if (memo != -1) { return memo; } const int on = n; ve> cnt; cnt.reserve(15); for (int i = 2; i * i <= on; ++i) { if (n % i == 0) { cnt.push_back({i, 0}); do { n /= i; cnt.back()[1] += 1; } while (n % i == 0); } } if (n != 1) { cnt.push_back({n, 1}); } return g(on, cnt); } int main() { #ifndef LOCAL ios::sync_with_stdio(0), cin.tie(0); #endif // dp.fill(-1); int n; cin >> n; int ans{}; while (n--) { int m; cin >> m; ans ^= f(m); } cout << (ans ? "Alice\n" : "Bob\n"); }