{"problem":{"name":"Bitwise OR Game","description":{"content":"There are $N$ piles of stones, and the $i$\\-th pile $(1\\le i\\le N)$ has $A_i$ stones. Alice and Bob will play the following game using these piles: *   Starting with Alice, the two players take turns","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc208_a"},"statements":[{"statement_type":"Markdown","content":"There 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 more stones from that pile. However, the player cannot make a move that changes the bitwise $\\mathrm{OR}$ of the numbers of stones of all piles.\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.\nWhat is bitwise $\\mathrm{OR}$?The bitwise $\\mathrm{OR}$ of non-negative integers $A$ and $B$, $A\\ \\mathrm{OR}\\ B$, is defined as follows:\n\n*   When $A\\ \\mathrm{OR}\\ B$ is written in binary, the digit in the $2^k$ place ($k \\geq 0$) is $1$ if at least one of the digits in the $2^k$ place of $A$ and $B$ written in binary is $1$, and $0$ otherwise.\n\nFor example, $3\\ \\mathrm{OR}\\ 5 = 7$ (in binary: $011\\ \\mathrm{OR}\\ 101 = 111$).  \nIn general, the bitwise $\\mathrm{OR}$ of $k$ non-negative integers $p_1, p_2, p_3, \\dots, p_k$ is defined as $(\\dots ((p_1\\ \\mathrm{OR}\\ p_2)\\ \\mathrm{OR}\\ p_3)\\ \\mathrm{OR}\\ \\dots\\ \\mathrm{OR}\\ p_k)$, and it can be proved that this is independent of the order of $p_1, p_2, p_3, \\dots p_k$.\n\n## Constraints\n\n*   $1\\le T\\le 10^5$\n*   $2\\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 A_i \\le 10^9$\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$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc208_a","tags":[],"sample_group":[["4\n3\n3 4 6\n3\n7 7 7\n3\n9 3 5\n10\n1 9 1 3 7 9 10 9 7 3","Alice\nBob\nBob\nAlice\n\nConsider the first test case.\nInitially, the bitwise $\\mathrm{OR}$ of the numbers of stones of all piles is $3\\ \\mathrm{OR}\\ 4\\ \\mathrm{OR}\\ 6=7$.\nThe moves Alice can make are as follows:\n\n*   Remove two stones from the first pile.\n*   Remove one or more stones from the second pile.\n*   Remove one or more stones from the third pile.\n\nFor example, if Alice removes one stone from the first pile, the bitwise $\\mathrm{OR}$ of the numbers of stones of all piles becomes $2\\ \\mathrm{OR}\\ 4\\ \\mathrm{OR}\\ 6=6$. Therefore, Alice cannot make the move of removing one stone from the first pile.\nIf Alice removes six stones from the third pile, Bob cannot make any move in the next turn. Therefore, the winner when both players play optimally is Alice."]],"created_at":"2026-03-03 11:01:14"}}