NOI Contest Archive

Archive / 2026 / Qualifier Round

Olinda Keliya

Medium · NOI 2026 Qualifier Round

During the Sinhala and Tamil New Year, two siblings are playing a strategic variation of the traditional game Olinda Keliya using bright red Olinda seeds.

Instead of a traditional board, they have carved a long, straight groove into a piece of wood with \(N\) small pits in a row, numbered \(1\) to \(N\) from left to right. Initially, the \(i^{\text{th}}\) pit contains \(A_i\) Olinda seeds.

The players take turns. In a single turn, a player must choose a pit \(i\) (where \(1 \le i < N\)) that currently contains at least one Olinda seed. The player picks up exactly one seed from pit \(i\) and drops it into the adjacent pit to the right, pit \(i+1\).

Pit \(N\) is the “Maha” (Great) pit. Once a seed is dropped into the Maha pit, it has reached its final destination and cannot be moved again.

The game ends when all the Olinda seeds on the board have been moved to the Maha pit (pit \(N\)). A player loses the game if it is their turn and they cannot make a valid move. The other player is then declared the winner.

Assuming both siblings play optimally, determine whether the First Player or the Second Player will win based on the starting arrangement of the seeds.

Input Format

The first line contains a single integer, \(T\), representing the number of test cases.

For each test case:

Output Format

For each test case, print a single line containing First if the first player wins, or Second if the second player wins.

Constraints

Sample Input 0

3
3
1 1 0
4
0 2 0 0
2
8 0

Sample Output 0

First
Second
Second