#include using namespace std; using int64 = long long; // returns true if the player to move, holding 'a' while the opponent holds 'b', has a winning strategy bool win(int64 a, int64 b) { // base cases if (a == 0) return false; // no moves, so current player loses if (b == 0) return true; // opponent has zero—this state can't actually occur in play, but treat as win // if a == 1, one subtract wins immediately if (a == 1) return true; // if b == 1, only subtracts are possible on your side, so you'll take 'a' moves; // you win iff that number of turns (on your own moves) arrives before opponent // but in fact one can show that this reduces to parity of a: // if a is odd, Alice (who moves first among the pair) wins; otherwise Bob // however, since here we're looking at the position for whichever player to move, // and they need exactly 'a' of their own moves to finish, they win if and only if // a % 2 == 1 if (b == 1) return (a % 2 == 1); // now both a, b >= 2 if (a < b) { // when b >= 2a, opponent on their move could divide by you twice (b/a >= 2) // and thus finish quickly; so if b/a >= 2, current player loses immediately int64 q = b / a; if (q >= 2) return false; // otherwise b/a == 1, so opponent can only reduce b -> b - a in one step. // We swap roles and hands: the next position is (b - a, a), and it's the opponent's move. // So current wins exactly when that position is losing for them: return !win(b - a, a); } else { // a >= b // if we can divide by opponent at least twice, we can force a win in one go int64 q = a / b; if (q >= 2) return true; // otherwise a/b == 1, so our only “big” move is a -> a - b. // After that, roles swap and it's opponent's turn on (b, a - b). return !win(b, a - b); } } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int64 A, B; cin >> A >> B; cout << (win(A, B) ? "Alice\n" : "Bob\n"); return 0; }