D - Harlequin 解説 /

実行時間制限: 2 sec / メモリ制限: 1024 MB

配点 : 500

問題文

一本のりんごの木があり、N 色のりんごが実っています。これらのりんごの N 種類の色には 1 から N までの番号が振られており、i 番の色のりんごは a_i 個あります。

あなたとダックスフンドのルンルンは、以下の行動を交互に行います (あなたから始めます)。

  • 木から 1 個以上のりんごを選んで食べる。ただし、一度に選ぶりんごは全て異なる色でなければならない。

木から最後のりんごを食べた者を勝者とします。あなたとルンルンがともに最善を尽くすとき、どちらが勝つでしょうか?

制約

  • 1 ≤ N ≤ 10^5
  • 1 ≤ a_i ≤ 10^9
  • 入力中の値はすべて整数である。

入力

入力は以下の形式で標準入力から与えられる。

N
a_1
a_2
:
a_N

出力

あなたが勝つなら first、ルンルンが勝つなら second と出力せよ。


入力例 1

2
1
2

出力例 1

first

1 番の色を赤、2 番の色を青とします。この例では、木には赤いりんご 1 個と青いりんご 2 個が実っています。

あなたは最初の手番で赤いりんごを食べるべきです。すると、ルンルンは青いりんごのうち片方を食べるほかなく、次の手番であなたがもう片方を食べて勝つことができます。

なお、あなたは最初の手番で両方の色のりんごを 1 個ずつ食べることもできます (勝ちには繋がりませんが)。


入力例 2

3
100000
30000
20000

出力例 2

second

Score : 500 points

Problem Statement

There is an apple tree that bears apples of N colors. The N colors of these apples are numbered 1 to N, and there are a_i apples of Color i.

You and Lunlun the dachshund alternately perform the following operation (starting from you):

  • Choose one or more apples from the tree and eat them. Here, the apples chosen at the same time must all have different colors.

The one who eats the last apple from the tree will be declared winner. If both you and Lunlun play optimally, which will win?

Constraints

  • 1 \leq N \leq 10^5
  • 1 \leq a_i \leq 10^9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
a_1
a_2
:
a_N

Output

If you will win, print first; if Lunlun will win, print second.


Sample Input 1

2
1
2

Sample Output 1

first

Let Color 1 be red, and Color 2 be blue. In this case, the tree bears one red apple and two blue apples.

You should eat the red apple in your first turn. Lunlun is then forced to eat one of the blue apples, and you can win by eating the other in your next turn.

Note that you are also allowed to eat two apples in your first turn, one red and one blue (not a winning move, though).


Sample Input 2

3
100000
30000
20000

Sample Output 2

second