{"problem":{"name":"Pocky Game","description":{"content":"There are $N$ piles of stones lying in a row. The $i$\\-th pile from the left contains $A_i$ stones. Two players, FirstLeft and SecondRight, play a game. They alternately play a turn, with FirstLeft go","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc048_d"},"statements":[{"statement_type":"Markdown","content":"There are $N$ piles of stones lying in a row. The $i$\\-th pile from the left contains $A_i$ stones.\nTwo players, FirstLeft and SecondRight, play a game. They alternately play a turn, with FirstLeft going first. In each turn, the player does the following operation:\n\n*   In FirstLeft's turn: he removes one or more stones from the **leftmost** pile with one or more stones.\n*   In SecondRight's turn: he removes one or more stones from the **rightmost** pile with one or more stones.\n\nThe player who becomes unable to play his turn loses. Determine the winner of the game when the players act optimally.\nSolve $T$ test cases in an input file.\n\n## Constraints\n\n*   $1 \\leq T \\leq 100$\n*   $1 \\leq N \\leq 100$\n*   $1 \\leq A_i \\leq 10^9$\n\n## Input\n\nInput is given from Standard Input in the following format. The first line of input is as follows:\n\n$T$\n\nThen, $T$ test cases follow, each of which is in the following format:\n\n$N$\n$A_1$ $A_2$ $\\cdots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc048_d","tags":[],"sample_group":[["3\n1\n10\n2\n3 2\n3\n2 1 2","First\nFirst\nSecond\n\nFor example, in the third game, one possible scenario is as follows:\n\n*   FirstLeft takes $2$ stones from the leftmost pile. The piles now contain $0,1,2$ stone(s).\n*   SecondRight takes $1$ stone from the rightmost pile. The piles now contain $0,1,1$ stone(s).\n*   FirstLeft takes $1$ stone from the middle pile. The piles now contain $0,0,1$ stone(s).\n*   SecondRight takes $1$ stone from the rightmost pile. The piles now contain $0,0,0$ stones.\n*   FirstLeft is unable to do his operation and loses."]],"created_at":"2026-03-03 11:01:14"}}