{"raw_statement":[{"iden":"problem statement","content":"There are positive integers $N$ and $M$, where $N \\lt M$.  \nAlice and Bob will play a game. Each player has $N$ cards with $1, 2, \\dots, N$ written on them, one for each number. Starting with Alice, the two players take turns repeatedly performing this action: choose one card from their hand and play it onto the table.  \nImmediately after a card is played onto the table, if the sum of the numbers on the cards that have been played so far is divisible by $M$, the player who just played the card loses, and the other player wins.  \nIf both players play all their cards without satisfying the above condition, Alice wins.  \nWho will win, Alice or Bob, when both play optimally?\nYou are given $T$ test cases. Solve each of them."},{"iden":"constraints","content":"*   $1 \\leq T \\leq 10^5$\n*   $1 \\leq N \\lt M \\leq 10^9$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format. Here, $\\mathrm{case}_i$ denotes the $i$\\-th test case.\n\n$T$\n$\\mathrm{case}_1$\n$\\mathrm{case}_2$\n$\\vdots$\n$\\mathrm{case}_T$\n\nEach test case is given in the following format:\n\n$N$ $M$"},{"iden":"sample input 1","content":"8\n2 3\n3 6\n5 9\n45 58\n39 94\n36 54\n74 80\n61 95"},{"iden":"sample output 1","content":"Alice\nAlice\nBob\nBob\nAlice\nBob\nBob\nAlice\n\nIn the first test case, the game could proceed as follows.\n\n*   Initially, both Alice and Bob have two cards: the card with $1$ and the card with $2$.\n*   Alice plays the card with $1$.\n    *   The sum of the numbers on the cards played so far is $1$, which is not divisible by $3$, so Alice does not lose.\n*   Bob plays the card with $1$.\n    *   The sum is now $2$, which is not divisible by $3$, so Bob does not lose.\n*   Alice plays the card with $2$.\n    *   The sum is now $4$, which is not divisible by $3$, so Alice does not lose.\n*   Bob plays the card with $2$.\n    *   The sum is now $6$, which is divisible by $3$, so Bob loses and Alice wins.\n\nIn the first test case, no matter how Bob plays, Alice can win."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}