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 (Python):



import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
a = [I() for _ in range(n)]
flg = 0
for i in a:
    if i % 2:
        flg = 1
if flg == 0:
    print('second')
else:
    print('first')

Solution (Python):
n = int(input())

a = [0] * n
for i in range(n):
    a[i] = int(input())

for i in range(n):
    if a[i] %2 == 0:
        continue
    else:
        print("first")
        exit()

print("second")

Solution (Python):
import sys

def main():
  input = sys.stdin.readline
  n = int(input())
  for i in range(n):
    a = int(input())
    if a % 2 == 1:
      print('first')
      exit()
  print('second')
  
if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = [int(input()) for _ in range(N)]
print('second' if all(A[i] % 2 == 0 for i in range(N)) else 'first')

Solution (Python):
n=int(input())
a=[]
for i in range(n):
    tmp=int(input())
    if tmp%2==1:
        print("first")
        import sys
        sys.exit()
print("second")

Solution (Python):
n=int(input())
a=[]
for i in range(n):
    tmp=int(input())
    if tmp%2==1:
        print("first")
        import sys
        sys.exit()
print("second")

Solution (Python):



def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]

    for ai in a:
        if ai % 2 == 1:
            print('first')
            exit()

    print('second')


if __name__ == '__main__':
    main()

Solution (Python):
def solve(n, a):
    for i in range(n):
        if a[i] % 2 == 1:
            return "first"
    return "second"

n = int(input())
a = [int(input()) for i in range(n)]
print(solve(n, a))

Solution (Python):
n = int(input())
A = [int(input()) for i in range(n)]
if all(a%2 == 0 for a in A):
    print('second')
else:
    print('first')

Solution (Python):
n=int(input())
arr=[int(input()) for _ in range(n)]
cnt=0
flag=0
for i in range(n):
  if arr[i]==1:
    cnt+=1
  else:
    if arr[i]%2==1:
      flag=1
if cnt==0:
  if flag==0:
    print('second')
  else:
    print('first')
else:
  print('first')

Solution (Python):
N = int(input())
ans = 'second'
for _ in range(N):
  if int(input()) % 2 == 1:
    ans = 'first'
    break
print(ans)

Solution (Python):
n = int(input())
for i in range(n):
    if int(input()) % 2 == 1:
        print("first")
        exit()
print("second")

Solution (Python):
N = int(input())
a = [int(input())for _ in range(N)]
flag = False
for i in a:
    if(i%2==1):
        flag = True
        break
if(flag):
    print('first')
else:
    print('second')

Solution (Python):
print('sfeicrosntd'[any([int(i)%2for i in open(0)][1:])::2])

Solution (Python):
print('sfeicrosntd'[any([int(i)%2for i in open(0)][1:])::2])

Solution (Python):

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


ans = (
    'first' if any(x % 2 == 1 for x in a) else
    'second'
)


print(ans)

Solution (Python):
n = int(input())
for i in range(n):
    if int(input())%2==1:
        print('first')
        exit()

print('second')

Solution (Python):
n = int(input())
a = [int(input()) for i in range(n)]
for i in a:
    if i%2==1:
        print('first')
        exit()
print('second')

Solution (Python):
N = int(input())
A = [int(input()) for i in range(N)]
 
ok = 1
for a in A:
    if a % 2 == 1:
        ok = 0
print(["first", "second"][ok])

Solution (Python):
n=int(input())
flag=0
for i in range(n):
  if int(input())%2==1:
    flag=1
print("first" if flag==1 else "second")

Solution (Python):
ans=('first','second')
k=1
n=int(input())
for i in range(n):
    if int(input())%2==1:
        k=0
print(ans[k])

Solution (Python):
n = int(input())

for _ in range(n):
    if int(input())%2 == 1:
        print("first")
        exit()
else:
    print("second")

Solution (Python):
n = int(input())
bool = False
for i in range(n):
    a = int(input())
    if a % 2 == 1:
        bool = True
        break
    else:
        continue
if bool:
    print("first")
else:
    print("second")

Solution (Python):
n = int(input())
a = [int(input()) for i in range(n)]
if any(i%2 for i in a): print("first")
else: print("second")

Solution (Python):

import sys


def solve(N: int, A: "List[int]"):
    for a in A:
        if a % 2 > 0:
            print('first')
            return
    print('second')
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    a = [ int(next(tokens)) for _ in range(N) ]  
    solve(N, a)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
input=sys.stdin.readline
N=int(input())
flag=True
for i in range(N):
    if int(input())%2==1:
        flag=False
        break
if flag:print('second')
else:
    print('first')

Solution (Python):
n = int(input())
print("second" if all([int(input())%2==0 for i in range(n)]) else "first")

Solution (Python):
n = int(input())
l = [int(input())%2 for _ in range(n)]
if any(l):
  print("first")
else:
  print("second")

Solution (Python):
N=int(input())
flg=True
for i in range(N):
    A=int(input())
    if A%2==1:
        flg=False

if flg:
    print("second")
else:
    print("first")

Solution (Python):
import operator
from functools import reduce

N = int(input())
a = []
for i in range(N):
	a.append(int(input()))
a = sorted(a)

aa = []
aa.append(a[0])
for i in range(N - 1):
	aa.append(a[i + 1] - a[i])

b = []

for i in range(N):
	if aa[-1 - i] % 2 == 0:
		b.append(0)
	else:
		b.append(1 + i)

if N == 1:
	if b[0] != 0:
		print("first")
	else:
		print("second")
else:
	ans = reduce(operator.xor, b)
	if ans != 0:
		print("first")
	else:
		print("second")

Solution (Python):
n = int(input())
flag = False
for i in range(n):
    a = int(input())
    if a % 2 != 0:
        flag = True

if flag:
    print("first")
else:
    print("second")

Solution (Python):
n = int(input())
for _ in range(n):
    if int(input()) % 2:
        print('first')
        exit()
print('second')

Solution (Python):
N = int(input())
A = [int(input()) for i in range(N)]

if all(map(lambda a: a % 2 == 0, A)):
    print('second')
else:
    print('first')

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(n)]

flag = False
for i in range(n):
  if a[i]%2 == 1:
    flag = True
    
print("first" if flag else "second")

Solution (Python):
print("second" if all([int(input()) % 2 == 0 for i in range(int(input()))]) else "first")

Solution (Python):
'''input
3
1
30000
20000
'''
import time
import math

n = int(input())
print("second" if all([int(input()) % 2 == 0 for i in range(n)]) else "first")

Solution (Python):
N = int(input())
aList = [int(input()) for _ in range(N)]

ans = "first"
for a in aList:
    if a % 2 == 1:
        break
else:
    ans = "second"

print(ans)

Solution (Python):
n = int(input())
a = []
i = 0
while i < n:
    a.append(int(input()))
    i += 1




result = 'second'
for j in a:
    if j % 2 != 0:
        result = 'first'
        break
print(result)

Solution (Python):
a = int(input())
k = 0
for i in range(a):
    b = int(input())
    if b%2!=0:
        k = 1
if k != 1:
    print("second")
else:print("first")

Solution (Python):
n = int(input().strip())
data = [int(input().strip()) for _ in range(n)]

print ("first" if any(x % 2 == 1 for x in data) else "second")

Solution (Python):
N = int(input())
for i in range(N):
  a = int(input())
  if (a % 2 == 1):
    print("first")
    exit()
print("second")

Solution (Python):
print('first') if [int(input())%2 for i in range(int(input()))].count(1)!=0 else print('second')

Solution (Python):
print('first') if [int(input())%2 for i in range(int(input()))].count(1)!=0 else print('second')

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    a = [I() for _ in range(n)]
    for c in a:
        if c % 2 == 1:
            return 'first'
    return 'second'


print(main())

Solution (Python):
N=int(input())
count=0
for i in range(N):
    count+=int(input())%2
if count>0:
    print("first")
else:
    print("second")

Solution (Python):
print('second' if all(int(input())%2==0 for _ in range(int(input()))) else 'first')

Solution (Python):
N = int(input())
a = []
s = 0
for i in range(N):
    a.append(int(input()))
    if a[i] % 2 == 0:
        s += 1
        
if s == N:
    re = 'second'
else:
    re = 'first'
    
print(re)

Solution (Python):
n = int(input())
ans = 0
for i in range(n):
    ans|=int(input())
if ans&1:
    print('first')
else:
    print('second')

Solution (Python):
N = int(input())
A = [int(input()) for i in range(N)]

ok = 1
for a in A:
    if a % 2 == 1:
        ok = 0
print(["first", "second"][ok])

Solution (Python):
import sys
print('second' if all(i%2==0 for i in list(map(int,sys.stdin))[1:]) else 'first')

Solution (Python):
print("second" if all(int(input())%2 == 0 for i in range(int(input()))) else 'first')

Solution (Python):
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
print('second' if all(a[i]%2==0 for i in range(n)) else 'first')

Solution (Python):
INF = 999999999999999999L
EPS = 1e-12

def read():
    return raw_input().strip()

def read_ints():
    return map(int,read().split())

n = int(read())
cnt = 0
for i in range(n):
    a = int(read())
    if a%2 == 1:
        cnt += 1
        
if cnt == 0:
    print "second"
else:
    print "first"

Solution (Python):


from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N = input()

flag = False
for i in range(N):
    if input() % 2 == 1:
        flag = True

if flag:
    print "first"
else:
    print "second"

Solution (Python):
N = int(input())
A = [int(input()) for i in range(N)]
odd = 0
for i in range(len(A)) :
    a = A[i]
    if a % 2 != 0 :
        odd += 1
        break
if odd == 1 :
    print("first")
else :
    print("second")

Solution (Python):
n=int(input())
if [i for i in [int(input()) for _ in range(n)] if i % 2]:
    print('first')
else:
    print('second')

Solution (Python):
N=int(input())

flag=False
for _ in range(N):
    a=int(input())
    if a%2==1:
        flag=True
if flag:
    print('first')
else:
    print('second')

Solution (Python):
N = int( input())
A = [ int( input()) for _ in range(N)]
for a in A:
    if a%2 == 1:
        print("first")
        break
else:
    print("second")

Solution (Python):
N = int(input())
A = [int(input())%2 for n in range(N)] 
 
for i in range(N):
    if A[i] == 1:
        print("first")
        break
else: print("second")

Solution (Python):
N = int(input())
A = [int(input()) for i in range(N)]

if [a for a in A if a % 2 == 1]:
    print('first')
else:
    print('second')

Solution (Python):
N = int(input())
A = [int(input()) for k in range(N)]

for a in A:
    if a%2 == 1:
        print("first")
        exit(0)
print("second")

Solution (Python):
n=int(input())
a=[int(input()) for i in range(n)]
b=list(set(a))
c=0
for i in range(n):
    if a[i]%2==1:
        c+=1
if len(b)==1 and b[0]==1:
    print("first")
elif sum(a)%2==0:
    if c%2==0 and c>=2:
        print("first")
    else:
        print("second")
else:
    print("first")

Solution (Python):
N = int(input())
a = [int(input()) for _ in range(N)]
win = False
for aa in a:
    if aa % 2 == 1:
        win = True
        break

print('first' if win else 'second')

Solution (Python):




def main():
    n = int(input())
    cnt = {0 : 0}
    for i in range(n):
        a = int(input())
        cnt[a] = cnt.get(a, 0) + 1

    keys = list(cnt.keys())
    keys.sort()

    ok = 0
    for i in range(len(keys)-1):
        k1, k2 = keys[i], keys[i+1]
        if (k2-k1) % 2:
            ok ^= n
        n -= cnt[k2]

    if ok:
        print("first")
    else:
        print("second")


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = []
for i in range(n):
    temp = int(input())
    a.append(temp)
now = -1 
for i in range(n):
    if a[i]%2 != 0:
        now = -1*(-1)
if now == -1:
    print("second")
else:
    print("first")

Solution (Python):
n = int(input())
a_list = [int(input()) for _ in range(n)]

d = ["second", "first"]

for a in a_list:
  if a % 2 != 0:
    print(d[1])
    break
else:
  print(d[0])

Solution (Python):
n = int(input())
a = [int(input()) for i in range(n)]

for i in range(n):
    if a[i] % 2 == 1:
        print("first")
        exit()
print("second")

Solution (Python):
import math
n=int(input())
color=[]
for i in range(0,n):
    color.append(int(input()))
tag=True
for k in color:
    if k%2!=0:
        tag=False
        break
if tag==True:
    print("second")
else:
    print("first")

Solution (Python):
n = int(input())
a = 0
for k in range(n):
    if int(input())%2 == 1:
        a = 1

if a == 1:
    print('first')
else:
    print('second')

Solution (Python):
N = int(input())
A = [int(input()) for n in range(N)]

for a in A:
    if a % 2 == 1:
        print("first")
        break
else:
    print("second")

Solution (Python):
N = int(input())
a =  [0] * N
flg = True
for i in range(N):
    a[i] = int(input())
    if a[i] % 2 != 0:
        flg = False


if not flg:
    print("first")
else:
    print("second")

Solution (Python):
N=int(input())
a = []
for i in [0]*N:
	a.append(int(input()))

'''
N=3
a=[100000,30000,20000]
'''

b=[x % 2 for x in a]

s = sum(b)
if s == 0:
	print("second")
else:
	print("first")

Solution (Python):
import copy


"""
def func(_left, turn):
    left = []
    for i in _left:
        if i != 0:
            left.append(i)
    N = [i for i in range(len(left))]  
    
    winFlag = False
    for i in range(1, 1 << len(N)):
        output = []
        copyLeft = copy.deepcopy(left)
        minus = 0
        for j in range(len(N)):
            if ((i >> j) & 1) == 1:
                output.append(j)  
                if copyLeft[j] > 0:
                    copyLeft[j] -= 1
                    minus += 1
        if minus == 0:
            continue
        
            
        if func(copyLeft, turn + 1):
            winFlag = True
    return not winFlag

def answer(a, turn):
    if not func(a, turn):
        return "{}:1st".format(a)
    else:
        return "{}:2nd".format(a)
print(answer([1], 0))
print(answer([2], 0))
print(answer([3], 0))
print(answer([4], 0))
print(answer([5], 0))
print(answer([6], 0))

print(answer([1, 1], 0))
print(answer([2, 1], 0))
print(answer([2, 2], 0))
print(answer([3, 1], 0))
print(answer([3, 2], 0))
print(answer([3, 3], 0))
print(answer([4, 2], 0))
print(answer([4, 4], 0))

print(answer([1, 1, 1], 0))
print(answer([2, 1, 1], 0))
print(answer([2, 2, 1], 0))
print(answer([2, 2, 2], 0))

print(answer([1, 1, 1], 0))
print(answer([2, 1, 1], 0))
print(answer([2, 2, 1], 0))
print(answer([2, 2, 2], 0))
print(answer([3, 1, 1], 0))
print(answer([3, 2, 1], 0))
print(answer([3, 2, 2], 0))
print(answer([3, 3, 1], 0))
print(answer([3, 3, 2], 0))
print(answer([3, 3, 3], 0))
print(answer([4, 4, 4], 0))
"""
"""
print()
print(answer([4, 1, 1, 1], 0))
print(answer([4, 2, 1, 1], 0))
print(answer([4, 2, 2, 1], 0))
print(answer([4, 2, 2, 2], 0))
print(answer([4, 1, 1, 1], 0))
print(answer([4, 1, 1, 1], 0))
print(answer([4, 1, 1, 1], 0))
print(answer([4, 1, 1, 1], 0))
"""
n = int(input())
a = [0 for _ in range(n)]
for i in range(n):
    a[i] = int(input())
for _a in a:
    if _a % 2 == 1:
        print("first")
        exit()
print("second")

Solution (Python):
n = int(input())
flag = False
for i in range(n):
	x = int(input())
	if (x & 1) == 1:
		flag = True
		break
print('first' if flag else 'second')

Solution (Python):
n=int(input())
list=[int(input()) for i in range(n)]

to = 1
for i in list:
    if i%2==1:
        to = 0
        break
if to==0:
    print('first')
else:
    print('second')

Solution (Python):
import sys, math
n = int(input())
a = [int(input()) for _ in range(n)]

for i in a:
    if i % 2 != 0:
        print('first')
        sys.exit(0)
print('second')

Solution (Python):
N, = [int(x) for x in input().strip().split(" ")]

r = "second"
for i in range(N):
    j, = [int(x) for x in input().strip().split(" ")]
    if j % 2 != 0:
        r = "first"
print(r)

Solution (Python):

import sys, os
try: from typing import Any, Union, List, Tuple, Dict
except ImportError: pass
sys.setrecursionlimit(10**6)
if os.environ.get("USER") == "shun":
    def debug(*args): print(*args, file=sys.stderr)
else:
    print("NO DEBUG", file=sys.stderr)
    def debug(*args): pass
def exit(): sys.exit(0)


n = int(input())
a = []
for _ in range(n):
    a.append(int(input()))


for i in range(n):
    if a[i] % 2 == 1:
        print("first")
        exit()
print("second")

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

N = int(input())
As = []
for n in range(N):
    As.append(int(input()))

first_win = False
for a in As:
    if a % 2 == 1:
        first_win = True
if first_win:
    print("first")
else:
    print("second")

Solution (Python):

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

for a in al:
    if a%2==1:
        print("first")
        exit()
print("second")

Solution (Python):
n = int(input())
a = [int(input()) for i in range(n)]

if any([v%2 == 1 for v in a]):
    print('first')
else:
    print('second')

Solution (Python):

def main():
    buf = input()
    N = int(buf)
    a = []
    for i in range(N):
        buf = input()
        a.append(int(buf))
    for i in a:
        if i % 2 == 0:
            continue
        else:
            print("first")
            return
    print("second")

if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
a=[int(input()) for i in range(N)]
for i in a:
  if i%2==1:
    print("first")
    exit()
print("second")

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(n)]

odd = False

for i in range(n):
	if a[i] % 2 == 1:
		odd = True

if odd:
	print("first")
else:
	print("second")

Solution (Python):
import sys
from collections import Counter

n = int(input())
aaa = [int(line) for line in sys.stdin.readlines()]
cnt = Counter(aaa)
nim = 0
mnt = 0
prev_i = 0
for i, c in sorted(cnt.items()):
    di = i - prev_i
    mnt += c
    if di % 2 == 1:
        nim ^= mnt
print('first' if nim > 0 else 'second')

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
a = [ni() for _ in range(n)]

isodd = False
for ai in a:
    if ai%2:
        isodd = True
        break

print("first") if isodd else print("second")

Solution (Python):
N = int(input())
for _ in range(N):
  a = int(input())
  if a % 2 != 0:
    print('first')
    exit()
print('second')

Solution (Python):
N = int(input())
ans = "second"

for i in range(N):
    a = int(input())
    if a % 2 == 1:
        ans = "first"
        break

print(ans)

Solution (Python):
N = int(input())
a = [int(input()) for _ in range(N)]
ans = "second"
for i in range(N):
  if a[i]%2 ==1 :
    ans = "first"

print(ans)

Solution (Python):
n = int(input())
a=[int(input()) for i in range(n)]

k = 0 

for i in range(n):
    if a[i] %2 == 1:
        k = 1

if k == 0:
    print('second')
else:
    print('first')

Solution (Python):
N = int(input())

A = [int(input()) for _  in range(N)]

A.sort()

xor_val =  0

last = 0
for i,a in enumerate(A):
    if i< N -1 and A[i]==A[i+1]:
        continue
    num = a-last
    if num%2:
        xor_val = xor_val ^ num

if xor_val:
    print("first")
else:
    print("second")

Solution (Python):
n = int(input())
alst = [int(input()) for _ in range(n)]
for a in alst:
  if a % 2 == 1:
    print("first")
    break
else:
  print("second")

Solution (Python):
N = int(input())
A = []
flg = False
for i in range(N):
  wk = int(input())
  A.append(wk)
  if wk % 2 > 0:
    flg = True
    
if flg:
  print("first")
else:
  print("second")

Solution (Python):
N = int(input())
A = [int(input()) for i in range(N)]
first = False
for a in A:
    if a % 2 == 1:
        first = True
print("first" if first else "second")

Solution (Python):
import sys
import collections
import itertools
import math
import re
from collections import Counter
from collections import deque
from collections import defaultdict
import bisect



N = int(input())
A = []

for i in range(N):
    a = int(input())
    A.append(a)

isAllEven = True

for a in A:
    if a % 2 == 1:
        isAllEven = False

if isAllEven == True:
    print("second")
else:
    print("first")

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(n)]

print("second" if sum(map(lambda ai: ai % 2, a)) == 0 else "first")

Solution (Python):

res = "second"
N = int(input())
for _ in range(N):
    a = int(input())
    if a % 2 == 1:
        res = "first"
        
print(res)

Solution (Python):
N = int(input())
A = [int(input()) for _ in range(N)]
if all(a % 2 == 0 for a in A):
    print("second")
else:
    print("first")

Solution (Python):
n=int(input())
a=[int(input()) for i in range(n)]
a=[i%2 for i in a]
if sum(a):print('first')
else: print('second')

Solution (Python):
import sys
input = sys.stdin.readline

N=int(input())
A=[int(input()) for i in range(N)]
A.sort()
A=[0]+A

XOR=0
for i in range(1,N+1):
    if (A[i]-A[i-1])%2==0:
        continue
    else:
        XOR=XOR^(N-(i-1))

    

if XOR!=0:
    print("first")
else:
    print("second")

Solution (Python):
def firstwin(a):
    odd = 0
    for x in a:
        if (x & 1) == 1:
            return True
    return False

def main():
    n = int(raw_input().strip())
    a = [int(raw_input().strip()) for i in xrange(n)]
    if firstwin(a):
        print 'first'
    else:
        print 'second'

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = [int(input()) for i in range(N)]

for a in A:
    if a%2:
        print('first')
        exit()
print('second')

Solution (Python):
N = int(input())

for i in range(N):
    if int(input()) % 2 == 1:
        print("first")
        break
else:
    print("second")

Solution (Python):
def main():
    n = int(raw_input())
    a = [int(raw_input(), 10) for _ in xrange(n)]
    f = 0
    for x in a:
        f |= x
    print "first" if f % 2 else "second"
main()

Solution (Python):
N=int(input())
a=[int(input()) for i in range(N)]
flag=0
for i in range(N):
    if a[i]%2==1:
        flag=1
if flag==1:
    print("first")
else:
    print("second")