Hide

Problem A
Alex and Barbossa

Alex and Barbossa, owners of the largest collection of unlabelled cards in the seven seas, are planning a fun game to pass the time during a lull of the ocean. Their first idea was no good, once they eventually realized that the winning strategy was so simple that a 51-character Ruby script could find the winning player. They’ve come up with a new version which is sure to make the game more interesting.

The new game is as follows: there is a stack of $k$ cards on the table. Alex and Barbossa take turns taking either $m$ or $n$ cards, beginning with Alex. The first player with no valid moves left loses.

Given $k$, $m$, and $n$, determine which player will win the game provided that both play with an optimal strategy.

Inputs

The input consists of a single line containing three space-separated integers $1 \leq k \leq 2 \cdot 10^9$ and $1 \leq m \leq n \leq 2 \cdot 10^9$.

Outputs

On a single line output the name of the winning player.

Sample Input 1 Sample Output 1
5 2 2
Barbossa
Sample Input 2 Sample Output 2
25 3 10
Alex
Sample Input 3 Sample Output 3
2 1 3
Barbossa

Please log in to submit a solution to this problem

Log in