- Time limit: 1.00 s
- Memory limit: 512 MB
There is a staircase consisting of stairs, numbered . Initially, each stair has some number of balls.
There are two players who move alternately. On each move, a player chooses a stair where and it has at least one ball. Then, the player moves any number of balls from stair to stair . The player who moves last wins the game.
Your task is to find out who wins the game when both players play optimally.
Note that if there are no possible moves at all, the second player wins.
Input
The first input line has an integer : the number of tests. After this, test cases are described:
The first line contains an integer : the number of stairs.
The next line has integers : the initial number of balls on each stair.
Output
For each test, print "first" if the first player wins the game and "second" if the second player wins the game.
Constraints
- the sum of all is at most
Example
Input:
3 3 0 2 1 4 1 1 1 1 2 5 3
Output:
first second first