#include using namespace std; using ll = long long; // custom hash for pair struct pair_hash { size_t operator()(pair const& p) const noexcept { // splitmix64 on the two 64‑bit halves auto h1 = p.first + 0x9e3779b97f4a7c15; auto h2 = p.second; // combine return std::hash()(h1 ^ (h2 >> 1)); } }; unordered_map, bool, pair_hash> memo; // returns true if the player to move with piles (a,b) can force a win bool win(ll a, ll b) { if (a < b) return !win(b, a); // if you can do a % b and it hits zero, you win immediately if (a % b == 0) return true; auto key = make_pair(a, b); auto it = memo.find(key); if (it != memo.end()) return it->second; // 1) Try the "mod" move ll r = a % b; if (!win(b, r)) { return memo[key] = true; } // 2) Try the "decrement" move: replace a by a-1 // then piles are (a-1, b), but roles swap: opponent sees (b, a-1) bool canWinByDec = false; if (a-1 < b) { // now b > a-1, so of (b, a-1) the current player wins iff win(a-1,b) is false // we need f(b,a-1)==false to be able to move there and win, // i.e. win(a-1,b)==true if (win(a-1, b)) canWinByDec = true; } else { // b <= a-1, so we directly ask if f(b, a-1)==false if (!win(b, a-1)) canWinByDec = true; } return memo[key] = canWinByDec; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll A, B; cin >> A >> B; cout << (win(A, B) ? "Alice\n" : "Bob\n"); return 0; }