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)

