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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    #残っている色の個数が偶数になるように行動
    N = int(input())
    A = list()
    for _ in range(N):
        if int(input()) % 2 == 1:
            break
    else:
        print('second')
        return
    print('first')
    return
    

    
main()

Submission status: Accepted

Solution code:
n,*a=map(int,open(0).read().split());print('first'if any(i%2==1 for i in a)else'second')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N, *a = map(int, open(0))
    for i in range(N):
        if a[i] % 2 == 1:
            print('first')
            exit()
    print('second')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()
    a = list(in_na())

    t = 0
    for i in range(N):
        t = t | a[i]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

def main():
    mod=10**9+7
    N=I()
    ans=1
    for i in range(N):
        a=I()
        if a%2==1:
            ans=0
            break
        
    S=["first","second"]
    print(S[ans])
                
    #奇数があれば先手の勝ち？
    #帰納法で証明できそう

main()

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
# if any(item%2==1 for item in a):
if not all(item%2==0 for item in a):
    ans = "first"
else:
    ans = "second"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

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

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())
a=[int(input()) for _ in range(n)]
flg=False
for x in a:
  if x%2==1:
    flg=True
if flg:
  print('first')
else:
  print('second')

Submission status: Accepted

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

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:
#!/usr/bin/env python3

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    L = [ii() for _ in range(n)]
    print('first') if any(map(lambda x: x%2 == 1, L)) else print('second')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    l = [int(input()) for _ in range(N)]

    if sum(l)%2==1:
        print('first')
    else:
        ret = 'second'
        for i in l:
            if i%2!=0:
                ret = 'first'
                break
        print(ret)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

N = int(readline())
A = [int(readline()) for i in range(N)]

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/caddi2018/tasks/caddi2018_b

n = int(input())
odd = even = 0
for _ in range(n):
    apple = int(input())
    if apple % 2 == 0:
        even += 1
    else:
        odd += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')
AtoZ = "abcdefghijklmnopqrstuvwxyz"

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  divisors.sort()
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
N = I()
A = ILs(N)

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

Submission status: Accepted

Solution code:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# a^n
def power(a,n,mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod

# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n-1
    while(tmp >= l):
        a = a*tmp%mod
        tmp -= 1
    return a

inf = 10**18
mod = 10**9+7

n = ir()
a = [ir() for i in range(n)]
odd = 0
for num in a:
    if num%2 == 1:
        odd+=1
if odd == 0:
    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())
ok = True;
for i in range(n):
  a = int(input())
  if a%2==1:
    ok = False
if ok:
  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:
import sys
input = sys.stdin.readline

"""
def dfs(x, y):
    if x==0 and y==0:
        return False
        
    res = False
    
    if x>0:
        res |= not dfs(x-1, y)
    
    if y>0:
        res |= not dfs(x, y-1)
    
    if min(x, y)>0:
        res |= not dfs(x-1, y-1)
    
    return res
    
t = [[False]*5 for _ in range(5)]

for i in range(5):
    for j in range(5):
        t[i][j] = dfs(i, j)

for ti in t:
    print(*ti)
"""

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

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

print('second')

Submission status: Accepted

Solution code:
N = int(input())
even = 0
A = []

for i in range(N):
    a = int(input())
    if not a%2:
        even += 1
    A.append(a)

if N == 1:
    print("sfeicrosntd"[(A[0]%2)::2])
elif sum(A) == N:
    print("first")
else:
    if even == N:
        print("second")
    else:
        print("first")

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:
n = int(input())
arr = [int(input()) for _ in range(n)]
print("second"if all(arr[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('second' if all(a[i]%2==0 for i in range(n))else 'first')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())


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


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


from collections import defaultdict, deque, Counter
from sys import exit
import math
import copy
from bisect import bisect_left, bisect_right
from heapq import *
import sys

# sys.setrecursionlimit(1000000)
INF = 10 ** 17
MOD = 1000000007

from fractions import *


def inverse(f):
    # return Fraction(f.denominator,f.numerator)
    return 1 / f


def combmod(n, k, mod=MOD):
    ret = 1
    for i in range(n - k + 1, n + 1):
        ret *= i
        ret %= mod

    for i in range(1, k + 1):
        ret *= pow(i, mod - 2, mod)
        ret %= mod

    return ret

MOD = 10 ** 9 + 7

def yaku(n):
    res = []
    for i in range(2, int(math.sqrt(n)) + 2):
        tmp = 0
        while(True):
            if n % i == 0:
                tmp += 1
                n //= i
            else:
                break
        if tmp != 0:
            res.append((tmp, i))
    if n != 1:
        res.append((1, n))
    return res

def solve():
    n = getN()
    lis = []
    for i in range(n):
        lis.append(getN())

    lis.sort()
    prev = 0
    res = []
    for idx, num in enumerate(lis):
        if (num - prev) % 2 == 1:
            res.append(idx + 1)
        prev = num
    ans = 0
    for re in res:
        ans = ans ^ re

    if ans != 0:
        print("first")
    else:
        print("second")
    # print(res)
    return
def main():
    n = getN()
    for _ in range(n):
        solve()


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
n=int(input())
a=[]
x=0
for i in range(n):
    x|=int(input())%2

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############

N = getN()
A = getArray(N)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
dat = []
oddcnt = 0
for _ in range(n):
    x = int(input())
    dat.append(x)
    if x % 2 == 1:
        oddcnt += 1
if oddcnt == 0:
    print("second")
else:
    print("first")

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(int(input()) for _ in range(n))

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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import *

def dfs(x, y):
    if x==0 and y==0:
        t[x][y] = False
        return False
    
    if x>=1:
        t[x][y] |= not dfs(x-1, y)
        
    if y>=1:
        t[x][y] |= not dfs(x, y-1)
        
    if min(x, y)>=1:
        t[x][y] |= not dfs(x-1, y-1)
   
    return t[x][y]
    
t = [[False]*7 for _ in range(7)]

for i in range(7):
    for j in range(7):
        dfs(i, j)

"""
for ti in t:
    print(*ti)
"""

N = int(input())
flag = True

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

Submission status: Accepted

Solution code:
import sys
from collections import deque

def solve():
    input = sys.stdin.readline
    N = int(input())
    first = False
    for _ in range(N):
        a = int(input())
        if a % 2 == 1: first = True
    if first: print("first")
    else: print("second")
    
            
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
n = int(input())
a = []
ans = 'second'
for i in range(n):
    ai = int(input())
    a.append(ai)
    if ai % 2 == 1:
        ans = 'first'
print(ans)

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:
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())
cnt=0
for i in range(n):
    a=int(input())
    cnt+=(a%2)
if cnt==0:
    print("second")    
else:
    print("first")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

for i in range(N):
  temp = int(input())
  if temp%2 == 0:
    continue
  else:
    print("first")
    exit()
print("second")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
for i in range(N):
    if int(input())%2 != 0:
        print("first")
        exit()
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:
N=int(input())
a=[0]*N

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

Submission status: Accepted

Solution code:
n=int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    n = II()
    aa = [II() for _ in range(n)]
    for a in aa:
        if a%2==1:
            print('first')
            return None
    print('second')
if __name__ == '__main__':
    main()

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:
def solve():
    N = int(input())
    for _ in range(N):
        if int(input()) % 2 != 0:
            print("first")
            return
    else:
        print("second")
    
if __name__ == '__main__':
    solve()

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())
al = [0] * n
for i in range(n):
    a = int(input())
    if a % 2 != 0:
        print('first')
        break
else:
    print('second')

Submission status: Accepted

Solution code:
def caddi18_d():
    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)

caddi18_d()

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
# print(n)
# print(a)

# - 色iのりんごの個数 ai
# - 1つ以上取る
# - 最後を取ったら勝ち

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

Submission status: Accepted

Solution code:
def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
  N = Z()
  A = [Z() for _ in range(N)]
  print('first' if any([a%2 == 1 for a in A]) else 'second')
  return

if __name__ == '__main__':
  main()

Submission status: Accepted

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

is_odd = [x%2==0 for x in a_list]

if all(is_odd):
    print('second')
else:
    print('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:
import sys

# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
import heapq
import decimal
# import statistics
import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    n = ni()

    a = []

    ans = 0
    flg = True
    for _ in range(n):
        tmp = ni()
        if tmp % 2:
            flg = False
    
    print("second" if flg else "first")


if __name__ == '__main__':
    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())
A = [int(input()) for _ in range(N)]

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

Submission status: Accepted

Solution code:
print("first" if any(int(input()) & 1 for _ in range(int(input()))) else "second")