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: Time Limit Exceeded

Solution code:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal
#from numba import jit

INF = 1 << 50
EPS = 1e-8
mod = 10 ** 9 + 7

def run():
    N, *A = map(int, read().split())
    dic = defaultdict(lambda:0)
    for a in A:
        dic[a] += 1
    G = {}

    for key in sorted(list(dic.keys())):
        G[N] = key
        N -= dic[key]

    criteria = 0
    for key in G.keys():
        for _ in range(G[key]):
            criteria ^= key

    if not criteria:
        print('second')
    else:
        print('first')
if __name__ == "__main__":
    run()

Submission status: Accepted

Solution code:
n = int(input())

ans = False

for _ in range(n):
    if int(input())%2 == 1:
        ans = True

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

Submission status: Accepted

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

if all(A):
    print("second")
else:
    print("first")

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

def main():
    N = int(input())
    for _ in range(N):
        a = int(input())
        if a%2 == 1:
            print('first')
            return
    print('second')
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[15]:


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


# In[16]:


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


# In[ ]:

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)]

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

Submission status: Accepted

Solution code:
import sys
from sys import exit
from collections import deque
from copy import deepcopy
from bisect import bisect_left, bisect_right, insort_left, insort_right
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import reduce
from math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def powmod(n,i,mod=MOD):
    return pow(n,mod-1+i,mod) if i<0 else pow(n,i,mod)
def div2(x):
    return x.bit_length()
def div10(x):
    return len(str(x))-(x==0)
def intput():
    return int(input())
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x,d=1):
        self.setdefault(x,0)
        self[x] += d
    def list(self):
        l = []
        for k in self:
            l.extend([k]*self[k])
        return l
class comb():
    def __init__(self, n, mod=None):
        self.l = [1]
        self.n = n
        self.mod = mod
    def get(self,k):
        l,n,mod = self.l, self.n, self.mod
        k = n-k if k>n//2 else k
        while len(l)<=k:
            i = len(l)
            l.append(l[i-1]*(n+1-i)//i if mod==None else (l[i-1]*(n+1-i)*powmod(i,-1,mod))%mod)
        return l[k]
def pf(x,mode='counter'):
    C = counter()
    p = 2
    while x>1:
        k = 0
        while x%p==0:
            x //= p
            k += 1
        if k>0:
            C.add(p,k)
        p = p+2-(p==2) if p*p<x else x
    if mode=='counter':
        return C
    S = set([1])
    for k in C:
        T = deepcopy(S)
        for x in T:
            for i in range(1,C[k]+1):
                S.add(x*(k**i))
    if mode=='set':
        return S
    if mode=='list':
        return sorted(list(S))

######################################################

N=intput()
A=[0]*N
for i in range(N):
    A[i]=intput()
judge(all([a%2==0 for a in A]),['second','first'])

Submission status: Accepted

Solution code:
import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect

n=int(input())
c=0
for i in range(n):
    a=int(input())
    if a%2==0:
        c+=1

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

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input())for _ in range(N)]
print('sfeicrosntd'[any(a%2 for a in A)::2])

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal
#from numba import jit

INF = 1 << 50
EPS = 1e-8
mod = 10 ** 9 + 7

def run():
    N, *A = map(int, read().split())
    dic = defaultdict(lambda:0)
    for a in A:
        dic[a] += 1
    G = {}

    for key in sorted(list(dic.keys())):
        G[N] = key
        N -= dic[key]

    criteria = 0
    for key in G.keys():
        if G[key] % 2:
            criteria ^= key

    if not criteria:
        print('second')
    else:
        print('first')
if __name__ == "__main__":
    run()

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

'''
奇数の果実が有れば先行の勝ち。
初手で全ての果実の個数が偶数になるようにとれば、
あとは、後攻の真似をし続けることができる。

一方、全ての果実が偶数なら、後攻は先攻の真似をすれば良い。

'''

def main():
	n = int(input())
	#b , c = tin()
	#s = input()	
	for i in range(n):
		v = int(input())
		if v % 2 == 1:
			return 'first'
	return 'second'
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
ans = [x for x in a if x%2 != 0]

if len(ans) == 0:
    print('second')
else:
    print('first')

Submission status: Accepted

Solution code:
f=True
for i in range(int(input())):
  a=int(input())%2
  if a:
    print("first")
    f=False
    break
if f:
  print("second")

Submission status: Accepted

Solution code:
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n = input_int()
    A = []

    for _ in range(n):
        A.append(input_int())
    for a in A:
        if a % 2 == 1:
            print("first")
            return

    print("second")

    return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint
from statistics import mean,median,mode

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

def RI():
    return list(map(int,input().split()))

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input()) for _ in range(n) ]

# ddict = defaultdict(lambda: 0)
# ddict = defaultdict(lambda: 1)
# ddict = defaultdict(lambda: int())
# ddict = defaultdict(lambda: list())
# ddict = defaultdict(lambda: float())

n = I()
a = CI(n)

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

Submission status: Accepted

Solution code:
'''
研究室PCでの解答
'''
import math
#import numpy as np
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7 #998244353
dir = [(-1,0),(1,0),(0,-1),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"


def main():
    n = int(ipt())
    for i in range(n):
        a = int(ipt())
        if a%2:
            print("first")
            exit()
    print("second")

    return None

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())


N = I()
a = [I() for _ in range(N)]

b = sum(a[i] % 2 for i in range(N))
print('second' if b == 0 else 'first')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


N = I()
a = [I() for _ in range(N)]

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
n = I()
A = [I() for _ in range(n)]
print('second' if all(a%2 == 0 for a in A) else 'first')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print("second" if all(i % 2 == 0 for i in map(
    int, open(0).read().split()[1:])) else "first")

Submission status: Accepted

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

for a in A:
    if a != 1:
        break
else:
    print('first')
    exit()

cnt = 0
for a in A:
    if a%2 == 0:
        cnt += 1
if cnt == n:
    print('second')
else:
    print('first')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, *A = map(int, open(0).read().split())
print("first") if any(a % 2 for a in A) else print("second")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
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 LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  N=I()
  a=[I() for _ in range(N)]

  for x in a:
    if x%2!=0:
      return 'first'

  return 'second'

# main()
print(main())

Submission status: Accepted

Solution code:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
ceil = math.ceil

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

Submission status: Accepted

Solution code:
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N=int(pin()[:-1])
  m=0
  for i in range(N):
    a=int(pin()[:-1])
    if a%2==0:
      m+=1
  if m==N:
    print("second")
  else:
    print("first")
    return 
main()

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
print(['second','first'][any([int(input())%2 for _ in range(int(input()))])])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    a2 = [ae&1 ^ 1 for ae in a]
    if all(a2):
        print('second')
    else:
        print('first')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    m = map(int, read().split())
    for a in m:
        if a&1:
            print('first')
            sys.exit()
    print('second')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
flag=False
for i in range(N):
    a=int(input())
    flag|=a%2



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

Submission status: Accepted

Solution code:
n = int(input())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)
b = True
for i in range(n):
    if l[i] % 2 != 0:
        b = False
if b:
    print('second')
else:
    print('first')

Submission status: Accepted

Solution code:


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = read_int()
    all_evens = True
    for _ in range(N):
        a = read_int()
        all_evens = all_evens and a%2 == 0
    if all_evens:
        return 'second'
    return 'first'


if __name__ == '__main__':
    print(solve())

Submission status: Accepted

Solution code:
N,*a = map(int, open(0).read().split())
for x in a:
    if x % 2 == 1:
        print('first')
        break
else:
    print('second')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,*a=map(int,open(0).read().split())

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

print('second')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

flag=0
for aa in a:
    if aa%2==1:
        flag=1

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

###1個
#111
#奇数ならfirst 偶数ならsecond

###２個
#111
#111
#奇数奇数ならfirst
#11
#11
#偶数偶数ならsecond
#

Submission status: Accepted

Solution code:
# if any tree contains an odd no of table then first is the winner
# First strategy is to make a tree with odd no of apples
# second strategy is to make a tree with even no of apples
# if the tree doesn't contain any odd apples when first takes an apples he will make it odd
# second would try to make it even by taking one apple from that tree
def main():
	n = int(input())
	ans =0
	f=0
	for i in range(0 , n):
		t = int(input())
		if t%2!=0:
			f=1
	if f==1:
		print("first")
	else:
		print("second")
if __name__=="__main__":
	main()

Submission status: Accepted

Solution code:

def main():
	n = int(input())
	ans =0
	f=0
	for i in range(0 , n):
		t = int(input())
		if t%2!=0:
			f=1
	if f==1:
		print("first")
	else:
		print("second")
if __name__=="__main__":
	main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline

sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    A = list(int(readline()) for _ in range(N))
    print('second' if all(A[i] % 2 == 0 for i in range(N)) else 'first')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

        
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()

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


    




                
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    a = [I() for _ in range(N)]

    # 1種類で奇数個なら自分の勝ち
    # 奇数個のりんごを1個食べて偶数個にする
    if len([i for i in a if i % 2 == 1]) == 0:
        print('second')
    else:
        print('first')

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

main()

Submission status: Accepted

Solution code:
# coding: utf-8
# hello worldと表示する
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
As = [True if int(input())%2==0 else False for _ in range(N)]

if all(As):
    print('second')
else:
    print('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:
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:
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    grundy = any([a % 2 != 0 for a in A])
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Accepted

Solution code:
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = []
for i in range(n):
    a.append(INT())
print("second" if all(a[i]%2 == 0 for i in range(n)) else "first")

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
flg = False
for i in range(N):
    A = int(input())
    if A % 2:
        flg = True
if flg:
    print("first")
else:
    print("second")

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    exist_odds = False
    for a in A:
        if a % 2 == 1:
            exist_odds = True
            break
    if exist_odds:
        print('first')
    else:
        print('second')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, *a = map(int, open(0).read().split())
s = sum(i % 2 for i in a)
print("sfeicrosntd"[s > 0::2])

Submission status: Accepted

Solution code:
n=int(input())
for i in range(n):
    t=int(input())
    if t%2!=0:
        print("first")
        exit()
print("second")

Submission status: Accepted

Solution code:
import sys

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

for i in a:
    if i % 2 == 1:
        print("first")
        sys.exit()

print("second")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    A = [0] * N
    for i in range(N):
        A[i] = int(input())

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
print('first'if any(int(input())%2 for _ in range(int(input())))else'second')

Submission status: Accepted

Solution code:
n = int(input())

for i in range(n):
    a = int(input())
    if a % 2 == 1:
        print("first")
        exit(0)

print("second")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    A = [int(input()) for _ in range(n)]
    if any([a % 2 != 0 for a in A]):
        print('first')
    else:
      	print('second')
        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10


#奇数個のリンゴがあったら先手の勝利
N = INT()
a = [INT() for _ in range(N)]

if any(x%2 for x in a):
	print("first")
else:
	print("second")