영어 원문입니다. 원문의 수식·표를 글자로 옮겨 모양이 다를 수 있습니다. 정확한 내용은 원문 페이지에서 확인하세요. 원문 페이지 열기 (새 창)
시간 제한 1초 · 메모리 제한 512 MB
Problem
There is a heap of n coins and two players who move alternately. On each move, a player chooses a heap and divides into two nonempty heaps that have a different number of coins. The player who makes the last move wins the game.
Your task is to find out who wins if both players play optimally.
Input
The first input line contains an integer t: the number of tests.
After this, there are t lines that describe the tests. Each line has an integer n: the number of coins in the initial heap.
Output
For each test case, print "first" if the first player wins the game and "second" if the second player wins the game.
Constraints
- 1 ≤ t ≤ 10^5
- 1 ≤ n ≤ 10^6
예제
예제 1
3 6 7 8
first second first