{"problem":{"name":"XY Game","description":{"content":"You are given positive integers $N$, $X$, $Y$ and a length-$N$ integer sequence $A=(A_1,A_2,\\ldots,A_N)$. There are $N$ piles of stones, and the $i$\\-th pile $(1\\le i\\le N)$ has $A_i$ stones. Alice an","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc208_e"},"statements":[{"statement_type":"Markdown","content":"You are given positive integers $N$, $X$, $Y$ and a length-$N$ integer sequence $A=(A_1,A_2,\\ldots,A_N)$.\nThere are $N$ piles of stones, and the $i$\\-th pile $(1\\le i\\le N)$ has $A_i$ stones.\nAlice and Bob will play the following game using these piles:\n\n*   Starting with Alice, the two players take turns alternately.\n*   In each turn, the player chooses one non-empty pile and removes one or two stones from that pile. However, the player cannot make a move such that the number of stones in that pile becomes a multiple of $X$ or a multiple of $Y$ after removing stones.\n\nThe player who cannot make a move first loses.\nDetermine which player wins when both players play optimally.\nYou are given $T$ test cases, solve each of them.\n\n## Constraints\n\n*   $1\\le T \\le 2\\times 10^5$\n*   $1\\le N \\le 2\\times 10^5$\n*   The sum of $N$ over all test cases is at most $2\\times 10^5$.\n*   $1\\le X < Y\\le 10^9$\n*   $1\\le A_i \\le 10^{18}$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$T$\n$\\text{case}_1$\n$\\text{case}_2$\n$\\vdots$\n$\\text{case}_T$\n\nEach test case is given in the following format:\n\n$N$ $X$ $Y$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc208_e","tags":[],"sample_group":[["3\n2 3 5\n4 12\n5 1 2\n1 2 3 4 5\n6 530 879\n17031 42909 97721 34323 39597 26999","Alice\nBob\nAlice\n\nConsider the first test case.\nFor example, the game proceeds as follows:\n\n*   Alice removes two stones from the first pile. The first pile has two stones remaining.\n*   Bob removes one stone from the second pile. The second pile has eleven stones remaining.\n*   Alice removes one stone from the first pile. The first pile has one stone remaining.\n*   Bob cannot make a move, so Bob loses and Alice wins.\n\nIn this test case, Alice always wins no matter how both players make their moves. Therefore, print `Alice` on the first line."]],"created_at":"2026-03-03 11:01:14"}}