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



Sample input:
2
1
2


Sample output:
first

Submission status: Wrong Answer

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

x = min(a)
total = 0

for i in range(N):
    total += a[i] - x

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

Submission status: Wrong Answer

Solution code:
N = int(input())
total = 0
for i in range(N):
    total += int(input())
    
if total % 2 == 0:
    print('second')
else:
    print('first')

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter

N = int(input())
apple_list = []
cnt = 0

for i in range(N):
	apple = int(input())
	apple_list.append(apple)

while True:
	hoge = 0
	for i in range(N):
		if hoge == 1:
			break
		if apple_list[i] > 0:
			apple_list[i] -= 1
			if apple_list[i] == 0:
				hoge += 1
	if apple_list.count(0) == N:
		break
	cnt += 1

if cnt % 2 == 0:
	print ("first")
else:
	print ("second")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
apple_list = []
cnt = 0

for i in range(N):
	apple = int(input())
	apple_list.append(apple)

#print(apple_list)

while True:
	hoge = 0
	for num, i in enumerate(apple_list):
		if hoge == 1:
			continue
		if i > 0:
			apple_list[num] -= 1
		if i-1 == 0:
			hoge += 1
	apple_cnt = 0
	for i in apple_list:
		if i == 0:
			apple_cnt += 1
	if apple_cnt == N:
		break
	cnt += 1
	#print(apple_list)

if cnt % 2 == 0:
	print ("first")
else:
	print ("second")
#print(apple_list)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = [int(input()) for i in range(N)]

print("first" if any(map(lambda x: x % 2 == 1, a)) else "second")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from operator import itemgetter
from itertools import *
from bisect import *
from collections import *
from heapq import *
from fractions import Fraction
import sys

sys.setrecursionlimit(10 ** 6)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

for _ in range(II()):
    if II()&1:
        print("first")
        exit()
print("second")

Submission status: Accepted

Solution code:
n = int(input())
e = 0
for i in range(n):
    x = int(input())
    if x%2 == 0:
        e += 1
if n != e:
    print("first")
else:
    print("second")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

n = int(input())
A = [int(input()) for i in range(n)]

sec = 1
for i in range(n):
    if A[i] % 2 == 1:
        sec = 0
if sec == 1:
    print("second")
else:
    print("first")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10
    
#solve
def solve():
    n = II()
    a = IR(n)
    if sum(map(lambda x: x & 1, a)):
        print("first")
    else:
        print("second")
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
c = 0
for i in a:
    c += i % 2
print("first" if c >= 1 else "second")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

FIRST = "first"
SECOND = "second"

def solve(N: int, a: "List[int]"):
    for i in range(N):
        if a[i]%2 == 1:
            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))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a=[]
for i in range(int(input())):
    a+=[int(input())]
print(['first','second'][all([i%2==0 for i in a])])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=[-1]*n
for i in range(n):
  a[i]=int(input())
  

def all_even(li):
  for i in li:
    if i%2!=0:
      return False
  return True


if all_even(a):
  print("second")
else:
  print("first")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
A = [0]*N
for i in range(N):
    A[i] = int(stdin.readline().rstrip())

if all([i % 2 == 0 for i in A]):
    print("second")
else:
    print("first")

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input())%2 for _ in range(N)]
print(['first','second'][sum(A)==0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
#print(a)
for i in range(n):
    if a[i]%2!=0:
        print('first')
        break
else:
    print('second')

Submission status: Accepted

Solution code:
n = int(input())

for i in range(n):
    a = int(input())
    if a%2 == 1:
        print('first')
        break

    if i == n-1:
        print('second')

Submission status: Accepted

Solution code:
N=int(input())
for i in range(N):
    a=int(input())

    if a % 2 == 1:
        print('first')
        break

    elif i==N-1:
        print('second')
    
    else:
        continue

Submission status: Accepted

Solution code:
n,*a=map(int,open(0));print("sfeicrosntd"[any(v%2for v in a)::2])

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
A = [int(input()) for _ in range(N)]
answer = 'first' if any(x&1 for x in A) else 'second'
print(answer)

Submission status: Accepted

Solution code:
import sys
N=int(input())

for i in range(N):
  if int(input())%2==1:
    print("first")
    sys.exit()

print("second")

Submission status: Accepted

Solution code:
n = int(input())
l = [int(input()) for i in range(n)]
fl = True
for i in l:
    fl&=(i%2==0)
if fl:
    print('second')
else:
    print('first')

Submission status: Accepted

Solution code:
ans = "second"
for _ in range(int(input())):
    if int(input()) % 2 == 1:
        ans = "first"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

for i in range(n):
    a = int(input())
    if a % 2 == 1:
        print('first')
        break
else:
    print('second')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
A=[int(input()) for _ in range(n)]
for a in A:
    if a%2:
        print('first')
        break
else:
    print('second')

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
flag = 0
for i in a:
  if i%2:
    flag = 1
    break
if flag == 0:print('second')
else:print('first')

Submission status: Accepted

Solution code:
import math,sys
def main():
    n = int(input())
    for i in range(0,n):
        if int(sys.stdin.readline()) % 2 == 1:
            print('first')
            sys.exit()
    print('second')

main()

Submission status: Accepted

Solution code:
# D
N = int(input())
a = [int(input()) for i in range(N)]
f = 'second'
for i in a:
    if i%2 == 1:
        f = 'first'
print(f)

Submission status: Accepted

Solution code:
n=int(input())
arr=[]
for _ in range(n):
    arr+=[int(input())]
found=False
for num in arr:
    if num%2==1:
        found =True
        break
if found:
    print('first')
else:print('second')

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) for i in range(n)]

ans = 'second'
for i in range(n):
    if A[i] % 2 == 1:
        ans = 'first'
        break
        
print(ans)

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
oddcnt = 0
for i in range(input()):
    if input()%2:
        oddcnt += 1
if oddcnt:
    print "first"
else:
    print "second"

Submission status: Accepted

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

if all(A[i]%2==0 for i in range(N)):
    print("second")
else:
    print("first")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Jan  1 12:22:07 2019

@author: Yamazaki Kenichi
"""

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

for i in range(N):
    if a[i] % 2 == 0:
        ans = 'second'
    else:
        ans = 'first'
        break

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) for i in range(n)]
ans = 'first'

if all(i % 2 == 0 for i in A):
    ans = 'second'
        
print(ans)

Submission status: Accepted

Solution code:
import sys

def main():
    n = int(input())
    
    def mod2(str_n):
        return int(str_n) % 2

    has_odd = any(map(mod2, sys.stdin.readlines()))

    if has_odd:
        print('first')
    else:
        print('second')
    return


main()

Submission status: Accepted

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

print("second" if all(i%2 == 0 for i in a) else "first")

Submission status: Accepted

Solution code:
N = int(input())

res = 'second'

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

print(res)

Submission status: Accepted

Solution code:
N = int(input())
a = [int(input()) for _ in range(N)]
if all(list(map(lambda x: x%2==0, a))):
  print("second")
else:
  print("first")

Submission status: Accepted

Solution code:
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))


for a in A:
    if a % 2 == 1:
        # 奇数個のりんごの木が一つでもあれば、先行がそれをとり、後攻にEの状態を押し付けるので先行の勝ち
        print("first")
        exit()

print("second")

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
N = int(input())
A = [int(input()) for _ in range(N)]
ans = ["first", "second"]
c = 0
for a in A:
    if a % 2 == 1:
        print(ans[0])
        exit()
print(ans[1])

Submission status: Accepted

Solution code:
c = 0
for i in [0]*int(input()):
  c += int(input())%2
print("sfeicrosntd"[min(c,1)::2])

Submission status: Accepted

Solution code:
c = 0
for i in [0]*int(input()):
  c = max(c,int(input())%2)
print("sfeicrosntd"[c::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
print(["second","first"][any([int(input())%2 for i in range(n)])])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
from itertools import product
def solve():
    for _ in range(int(input())):
        if int(readline()) & 1:
            return "first"
    return "second "
print(solve())

Submission status: Accepted

Solution code:
def solve():
    for _ in range(int(input())):
        if int(input()) & 1:
            return "first"
    return "second "
print(solve())

Submission status: Accepted

Solution code:
N = int(input())
An = []
for p in range(N):
    Ai = int(input())
    An.append(Ai)
res = True
for i in An:
    if i % 2 != 0:
        res = False
print("second" if res else "first")

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
for i in range(N):
    if int(input()) % 2 != 0:
        cnt += 1
        exit

if cnt == 0:
    print("second")
else:
    print("first")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
#b, c = map(int, input().split())
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

N = int(input())
ans = 'second'
for i in range(0, N):
    a = int(input())
    if a % 2 == 1:
        ans = 'first'
        break
print("{}".format(ans))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
#b, c = map(int, input().split())
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

N = int(input())
ans = 'second'
for i in range(0, N):
    a = int(input())
    if a % 2 == 1:
        ans = 'first'
print("{}".format(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = False
for _ in range(n):
  i = int(input())
  if i % 2 == 1:
    ans = True
    break
if ans:
  print('first')
else:
  print('second')

Submission status: Accepted

Solution code:
n = int(raw_input())

answer = "second"

for i in xrange(n):
    a = int(raw_input())
    if not a % 2 == 0:
        answer = "first"

print answer

Submission status: Accepted

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

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

Submission status: Accepted

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

if all(A[i] % 2 == 0 for i in range(N)):
    print("second")
else:
    print("first")

Submission status: Accepted

Solution code:
n=int(input())
array=[]
for i in range(n):
    array.append(int(input()))
cnt=0
for i in range(n):
    if array[i]%2==0:
        cnt+=1
if(cnt==len(array)):
    print("second")
else:
    print("first")

Submission status: Accepted

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

Submission status: Accepted

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

result = False
for a in A:
    if a % 2 == 1:
        result = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
d = [int(input()) for _ in range(n)]
flag = True
for i in d:
    if i % 2:
        print("first")
        exit(0)
print("second")

Submission status: Accepted

Solution code:
n = int(input())
for _ in range(n):
  if int(input())%2==1:
    print('first')
    break
else:
  print('second')

Submission status: Accepted

Solution code:
t = int(input())

count = 0

for i in range(t):
    a = int(input())
    if a %2 == 1:
        count += 1
        
if count > 0:
    print("first")
    
else:
    print("second")

Submission status: Accepted

Solution code:
n=int(input())
arr=[]
for i in range(n):
	x=int(input())
	arr.append(x)
for x in arr:
	if x%2!=0:
		print("first")
		exit()
print("second")

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

"""
本番終了後、ちょっと修正版
"""

N = int(input())

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) for _ in range(n)]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = []
all_even = True
for _ in range(N):
    if int(input()) % 2 != 0:
        all_even = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
As = []
for i in range(N):
    As.append(int(input()))
        

print("second" if all(a % 2 == 0 for a in As) else "first")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a_list = []
for i in range(n):
    a_list.append(int(input()))
count = 0
for item in a_list:
  if item%2 == 0:
    count += 1
if count == n:
  print("second")
else:
  print("first")

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N=input()

for i in range(N):
	x=int( sys.stdin.readline() )
	if x%2==1:
		print "first"
		quit()
else:
	print "second"

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
print("first" if any(x % 2 for x in A) else "second")

Submission status: Accepted

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

print('second' if all(a_list[i] % 2 == 0 for i in range(n)) else 'first')

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
for i in range(0, N):
    if int(input()) % 2 == 1:
        cnt = cnt + 1

if cnt > 0:
    print('first')
else:
    print('second')

Submission status: Accepted

Solution code:
n=int(input())
c=[int(input())%2 for i in range(n)]
print("first"if sum(c)>0 else "second")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
n = int(input())
a_list = []
cnt = 0
for _ in range(n):
    a = int(input())
    if a % 2 == 0:
        cnt += 1
if cnt == n:
    print('second')
else:
    print('first')

Submission status: Accepted

Solution code:
N = int(input())
ais = []
for i in range(N):
    ais.append(int(input()))
bis = list(map(lambda x: x%2, ais))
if bis==[0]*N:
    print("second")
else:
    print("first")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = [int(input()) % 2 for _ in range(N)]
res = sum(a)
print("first" if res > 0 else "second")

Submission status: Accepted

Solution code:
n=int(input())
flag=0
for i in range(n):
  a=int(input())
  if a%2==1:
    flag=1
    break
  else:
    pass
if flag==1:
  print('first')
else:
  print('second')

Submission status: Accepted

Solution code:


if __name__ == '__main__':
    num = int(input())
    # data = [int(input()) for i in range(num)]

    ans = 0
    count_e, count_o = 0, 0
    for i in range(num):
        data = input()
        if int(data[-1]) % 2 == 1:
            count_o += 1
            break
        # else:
        #     count_e += 1
    # if count_o % 2 == 1 and count_e % 2 == 0:
    #     print('first')
    # elif count_o % 2 == 1 and count_e % 2 == 1:
    #     print('first')
    # elif count_o % 2 == 0 and count_e % 2 == 1:
    #     print('second')
    # elif count_o % 2 == 0 and count_e % 2 == 0:
    #     print('second')
    #
    if count_o % 2 == 0:
        print('second')
    else:
        print('first')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n =int(input())
a = int(input())
b =[a]
v = 0
if a == 1:
    v = 1
if a%2 ==1:
    ans = 1
else:
    ans = -1
    q = 1
for i in range(1,n):
    a = int(input())
    b.append(a)
    if a == 1:
        v =1
    if a%2==1:
        v= 1
if ans == 1 or v == 1:
   print('first')
else:
    print('second')

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
a = np.array([int(input()) for i in range(N)])
max_val = np.max(a)

max_val_even = np.all(max_val%2==0)
max_val_odd = np.all(max_val%2!=0)
N_even = np.all(N%2==0)
N_odd = np.all(N%2!=0)
all_even = np.all(a%2==0)
all_odd = np.all(a%2!=0)

if max_val_odd:
  print("first")
else:
	if all_even:
	  	print("second")
	else:
 		print("first")

Submission status: Accepted

Solution code:
N=  int(input())
c= True
for i in range(N):
    if int(input()) % 2 == 1:
        c = False

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

Submission status: Accepted

Solution code:
n=int(input())
l=[int(input()) for i in range(n)]
#print(l)
a=0
for i in range(n):
    if l[i]%2==1:
        print('first')
        exit()
    a+=l[i]
    a%=2
if a==1:
    print('first')
else:
    print('second')

Submission status: Accepted

Solution code:
n=int(input())
a=[]
count=0
for i in range(n):
    a.append(int(input()))
    count+=a[i]
    if a[i]%2==1:
        count=1
        break
if count%2==0:
    print("second")
else:
    print("first")

Submission status: Accepted

Solution code:
N = int(input())
A = []
Even_count = 0
for i in range(N):
    a = int(input())
    if a % 2 == 0:
        Even_count += 1
    A.append(a)
if Even_count == N:
    print("second")
else:
    print("first")

Submission status: Accepted

Solution code:
N = int(input())
mp = {}
for _ in range(N):
    i = int(input())
    mp[i] = mp.get(i, 0) + 1
for i in mp.keys():
    if i % 2 == 1:
        print('first')
        exit()
print('second')

Submission status: Accepted

Solution code:
N = int(input())
a = [int(input()) for x in range(N)]

anslist = [0 if x%2==0  else 1 for x in a]
if sum(anslist) > 0:
    print("first")
else:
    print("second")

Submission status: Accepted

Solution code:
N = int(input())
a = []
for _ in range(N):
    a.append(int(input())%2)
if sum(a) == 0:
    print('second')
else:
    print('first')

Submission status: Accepted

Solution code:
n = int(input())
aa = [int(input()) for _ in range(n)]
total = all([a % 2 == 0 for a in aa])
if total:
    print('second')
else:
    print('first')

Submission status: Accepted

Solution code:
"""
勝利条件
    最後のリンゴを取る
    1種類で2個のリンゴを残す
    2種類で2個2個のリンゴを残す
    3種類で2個2個2個のリンゴを残す

    1種類で4個のリンゴを残す
    2種類で4個4個のリンゴを残す


    全種類のリンゴを偶数にするゲーム
    全種類のリンゴが偶数じゃない場合は勝てるゲーム
    1つでも奇数があれば勝てるゲーム
    
"""

n = int(input())
a = [int(input()) % 2 != 0 for _ in range(n)]  # 奇数ならTrue、偶数ならFalse

if any(a):
    print("first")
else:
    print("second")

Submission status: Accepted

Solution code:
N = int(input())
a = 0
for i in range(N):
    a += int(input())%2

if a > 0:
    print("first")
else:
    print("second")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
b = 0
for i in range(n):
    a = int(input())
    if a % 2 == 1:
        b += 1
        break

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for i in range(N)]
ans = []
for i in range(N):
  tmp = A[i] % 2
  ans.append(tmp)
if sum(ans) == 0:
  print("second")
  exit()
print("first")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input().strip())
a = []
for i in range(0, N):
    ak = int(input().strip())
    a.append(ak)

ME = 'first'
RUN = 'second'

me_win = True
all_even = True
for ai in a:
    all_even &= ai%2 == 0
me_win = not all_even

print(ME if me_win else RUN)

Submission status: Accepted

Solution code:
import fractions
from functools import reduce

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

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

res = gcd(*a)
if res % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Accepted

Solution code:
N = int(input())

flag = False
for _ in range(N):
    a = int(input())
    if a % 2 == 1:
        flag = True
        break

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

Submission status: Accepted

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

Submission status: Accepted

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