Problem:
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

Solution in Python (3.4.3) (judge verdict: Wrong Answer)

import collections
from functools import reduce

n = int(input())

a = list([int(input()) for _ in range(n)])

kai = 0

if len(set(a)) == 1:
    if len(set(a)) % 2 == 1:
        print('first')
    else:
        print('second')

    exit(0)


def gcd(a, b):
    while b:
        a, b = b, a % b

    return a


mi = int(reduce(gcd, a))
a = list(map(lambda x: x // mi, a))


def eat(l):
    li = reduce(gcd, l)
    if li != 0:
        l = list(map(lambda x: x//li, l))


    for i in range(len(l)):
        if l[i] % 2 == 1:
            l[i] -= 1

#    print(l)
    return l



while True:
    kai += 1

    if a.count(0) == n-1:
        nokori = collections.Counter(a).most_common()[1][0]
        kai += (nokori - 1)

        if kai % 2 == 0:
            print('second')
        else:
            print('first')

        exit(0)


    a = eat(a)