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:
from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import bisect
import sys
#import sympy
sys.setrecursionlimit(10**6)


def bfs(s,n,node):
    #頂点が探索済みかどうかのチェック配列
    check=[False for _ in range(n)]
    check[s]=True
    #次見る頂点を格納するキュー
    queue=deque([s])
    visited_num=1

    #問題固有の配列
    #color_check=[[True for _ in range(l)] for _ in range(n)]
    color=[-1 for _ in range(n)]
    color[s]=0
    
    while visited_num<n:
        #グラフが全連結ではない場合
        if len(queue)==0:
            #空配列を返す
            #現状までの計算済み配列を返してもいいと思う
            return color

        now_vertex=queue.popleft()
        #インデックスがない場合は
        for next_vertex in node[now_vertex]:


            if check[next_vertex]==True:
                continue

            queue.append(next_vertex)
            check[next_vertex]=True

            #問題固有の計算
            color[next_vertex]=color[now_vertex]+1
            visited_num+=1

    return color

#n=int(input())z
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))



n=int(input())
#n,m=input_list()
start=0
#a=input_list()
a=[int(input()) for _ in range(n)]
for each in a:
    if each%2==1:
        start=1-start

if start==1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

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 % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

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 %2 != 0:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

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 %2 == 1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[]
for i in range(N):
    a=int(input())
    A.append(a)
if max(A)==1:
    print("first")
    exit()

s=sum(A)
if s%2==0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

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

s=sum(A)
if s%2==0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
n=int(input())
non1=0
k=0
for i in range(n):
  s=int(input())
  if s!=1:
    non1+=1
  k+=s
if non1<=1:
  print('first')
else:
  if k%2==0:
    print('second')
  else:
    print('first')

Submission status: Wrong Answer

Solution code:
n=int(input())
non1=0
k=0
for i in range(n):
  s=int(input())
  if s==1:
    non1+=1
  k+=s
if non1<=1:
  print('first')
else:
  if k%2==0:
    print('second')
  else:
    print('first')

Submission status: Wrong Answer

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

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

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

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

N = int(input())

if N==1:
    print('first')
    exit()
    
cnt = 0

for _ in range(N):
    a = int(input())
    
    if a%2==1:
        cnt += 1

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

Submission status: Wrong Answer

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

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

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

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

N = int(input())
cnt = 0

for _ in range(N):
    a = int(input())
    
    if a%2==1:
        cnt += 1

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range (n)]
cnt=0
for i in a:
    if i==1:
        cnt+=1
    else:
        cnt+=2

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range (n)]
cnt=0
for i in a:
    if i==1:
        cnt+=1
    else:
        cnt+=2

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

Submission status: Wrong Answer

Solution code:
n=int(input())
x=0
cnt=0
for i in range(n):
    a=int(input())
    x=max(a,x)
    cnt+=a
if x==1:
    print("first")
else:
    if (cnt-2)%2==1:
        print("first")
    else:
        print("second")

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0
s=0
for i in range(n):
    a=int(input())
    cnt+=(a-1)%2
    cnt%=2
    s+=a
if s==n:
    print("first")
else:
    if n%2==0:
        if cnt==0:
            print("second")
        else:
            print("first")
    else:
        if cnt==1:
            print("second")
        else:
            print("first")

Submission status: Wrong Answer

Solution code:
n=int(input())
x=0
cnt=0
for i in range(n):
    a=int(input())
    cnt+=(a-1)%2
    cnt%=2
    x=max(a,x)
if x==1:
    print("first")
else:
    if n%2==0:
        if cnt==0:
            print("second")
        else:
            print("first")
    else:
        if cnt==0:
            print("second")
        else:
            print("first")

Submission status: Wrong Answer

Solution code:
n=int(input())
x=0
cnt=0
for i in range(n):
    a=int(input())
    cnt+=(a-1)%2
    cnt%=2
    x=max(a,x)
if x==1:
    print("first")
    if n%2==0:
        if cnt==0:
            print("second")
        else:
            print("first")
    else:
        if cnt==0:
            print("second")
        else:
            print("first")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
As = list(map(int, input().split()))

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

Submission status: Wrong Answer

Solution code:
N = int(input())
if N ==1:
  temp = int(input())
  if temp %2 == 0:
    print("second")
  else:
    print("first")
  exit()

kachi = False;Gu = False; Ki = False
for i in range(N):
  temp = int(input())
  if i == 0:
    if temp%2 ==0:
      Gu = True
    else:
      Ki = True
  else:
    if Gu and temp%2 == 0:
      continue
    elif Ki and temp%2 == 1:
      continue
    else:
      kachi= True
      break
if kachi:
  print("first")
else:
  print("second")

Submission status: Wrong Answer

Solution code:
N = int(input())
kachi = False;Gu = False; Ki = False
for i in range(N):
  temp = int(input())
  if i == 0:
    if temp%2 ==0:
      Gu = True
    else:
      Ki = True
  else:
    if Gu and temp%2 == 0:
      continue
    elif Ki and temp%2 == 1:
      continue
    else:
      kachi= True
      break
if kachi:
  print("first")
else:
  print("second")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())
x = max(a)
total = sum(a) - x
print("first" if x % 2 != total % 2 else "second")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

   
print("first" if max(a)%2==0 and (sum(a)-max(a))%2==1 else "second" )

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
al = [0] * n
for i in range(n):
    al[i] = int(input())

if n == 1:
    if al[0] % 2 == 0:
        print('second')
    else:
        print('first')
    exit()

t = al[-1]
al.sort()
for i in range(n-1):
    t += (al[i+1] - al[i])
if t % 2 == 0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
n = int(input())
al = [0] * n
for i in range(n):
    al[i] = int(input())

if n == 1:
    if al[0] % 2 == 0:
        print('second')
    else:
        print('first')
    exit()

t = al[0]
al.sort()
for i in range(n-1):
    t += (al[i+1] - al[i])
if t % 2 == 0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
n = int(input())
al = [0] * n
for i in range(n):
    al[i] = int(input())

if n == 1:
    if al[0] % 2 == 0:
        print('second')
    else:
        print('first')
    exit()

t = 0
al.sort()
for i in range(n-1):
    t += (al[i+1] - al[i])
if t % 2 == 0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

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
    max_a = 0
    for _ in range(n):
        tmp = ni()
        a.append(tmp)

        ans += tmp % 2
        max_a = max(max_a, tmp)

    ans %= 2
    flg = a.count(1) == n - 1
    print("first" if ans or max_a == 1 or flg else "second")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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
    max_a = 0
    for _ in range(n):
        tmp = ni()
        a.append(tmp)

        ans += tmp % 2
        max_a = max(max_a, tmp)

    ans %= 2
    flg = a.count(max_a) == 1
    print("first" if ans or max_a == 1 or (max_a == 2 and flg) else "second")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    ans = 0
    max_a = 0
    for _ in range(n):
        tmp = ni()
        ans += tmp % 2
        max_a = max(max_a, tmp)

    ans %= 2
    print("first" if ans or max_a == 1 else "second")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    ans = 0
    for _ in range(n):
        ans += ni() % 2

    ans %= 2
    print("first" if ans else "second")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    m = min(int(input()) for _ in range(int(input())))
    print("first" if m & 1 else "second")
resolve()

Submission status: Wrong Answer

Solution code:
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    s = sum(int(input()) for _ in range(int(input())))
    print("first" if s & 1 else "second")
resolve()

Submission status: Wrong Answer

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

    ans = 0
    for i in range(N):
        ans += (a[i] % 2)
        ans %= 2

    if ans == 1:
        print("first")
    else:
        print("second")

if __name__ =="__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, 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
from fractions import gcd
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

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

xor = lambda x, y: x^y

print("first" if reduce(xor, a)%2 else "second")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split(' ')))

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

Submission status: Wrong Answer

Solution code:
N=int(input())
#ラス２を相手に食べさせる
#残り1種類の奇数→偶数を自分が担当
#残り1種類、偶数で　相手に渡す

# 2 3
A=[]
for i in range(N):
  a=int(input())
  A.append(a)

if sum(A)%2==1:
  print("first")
else:
  print("second")

Submission status: Wrong Answer

Solution code:
N=int(input())
#ラス２を相手に食べさせる
#残り1種類の奇数→偶数を自分が担当
#残り1種類、偶数で　相手に渡す

# 2 3
A=[]
for i in range(N):
    a=int(input())
    A.append(a)

A=sorted(A, reverse=True)
if N==1:
    if sum(A)%2==1:
        print("first")
    else:
        print("second")
    exit()
if (A[0]-A[1])%2==1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
N=int(input())
#ラス２を相手に食べさせる
#残り1種類の奇数→偶数を自分が担当
#残り1種類、偶数で　相手に渡す

# 2 3
A=[]
for i in range(N):
    a=int(input())
    A.append(a)

A=sorted(A, reverse=True)
if N==1:
    if N%2==1:
        print("first")
    else:
        print("second")
    exit()
if (A[0]-A[1])%2==1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

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

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

if odd_flag:
    print("first")
else:
    print("No")

Submission status: Wrong Answer

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

odd_flag = False
for a in range(N):
    if a % 2 == 1:
        odd_flag = True
        break

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

Submission status: Wrong Answer

Solution code:
import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


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


def main():
    N = int(input())
    A = []
    for _ in range(N):
        a = int(input())
        A.append(a)
    A.sort(reverse=True)

    if N == 1:
        if A[0] % 2 == 0:
            print("first")
        else:
            print("second")
    else:
        a1 = A[0]
        a2 = A[1]
        if a1 % 2 == 0 and a2 % 2 == 0:
            print("second")
        else:
            print("first")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for _ in range(n):
    a.append(int(input()))
    
b = sum(a)
if b % 2 == 0 and n % 2 == 1:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
a = [0] * N
for i in range(N):
    a[i] = int(input())
a.sort(reverse=True)
c = collections.Counter(a)

def solve():
    if a[0] % 2:
        return True
    else:
        return c[a[0]-1] > 0
print('first' if solve() else 'second')

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[]
flag=False
for i in range(N):
    A.append(int(input()))
    if A[i]%2==0:
        flag=True

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

Submission status: Wrong Answer

Solution code:
N=int(input())
a=[]
m=10**10
for i in range(N):
    a.append(int(input()))
    m=min(m,a[i])

if m>N:
    if N%2==0:
        print("first")
    else:
        print("second")
    exit()
else:
    print("second")

Submission status: Wrong Answer

Solution code:
import numpy as np

def main():
    stdin = np.fromstring(open(0).read(), dtype=np.int64, sep=' ')
    N = stdin[0]
    A = stdin[1:]
    A = np.mod(A, 2)
    print("first") if np.count_nonzero(A) % 2 else print("second")
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = [int(readline()) for i in range(n)]
if sum(a) % 2 == 1 or (len(set(a)) == 1 and a[0] % 2 == 1):
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = [int(readline()) for i in range(n)]
if sum(a) % 2 == 1 or len(set(a)) == 1:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = [int(readline()) for i in range(n)]
set_a = list(set(a))
if sum(a) % 2 == 1 or (len(set_a) == 1 and set_a[0] == 1):
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

Submission status: Wrong Answer

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 min(a) & 1 or sum(a) & 1:
        print("first")
    else:
        print("second")
    return


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

Submission status: Wrong Answer

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 min(a) & 1:
        print("first")
    else:
        print("second")
    return
    return


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

Submission status: Wrong Answer

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

def main():
  n = int(input())
  odd_count = sum([int(input()) % 2 for _ in range(n)])
  print('first' if odd_count % 2 == 1 else 'second')

if __name__=='__main__':
  main()

Submission status: Wrong Answer

Solution code:
N = int(input())
ret = "seconde"
for _ in range(N):
    a = int(input())
    if a % 2 != 0:
        ret = "first"
print(ret)

Submission status: Wrong Answer

Solution code:
N = int(input())
As = [int(input()) for i in range(N)]
# 異なる色のりんごを選び続ける
# 自分のターン終了時に残りを偶数にしておくことが大事
"""
2以上にできるりんごの木の数
⇨ 1こずつ減らしていくとｋ仮定して、偶数か奇数か
2にできるものの個数が偶数か奇数か
"""

cnt = 0
add = 0
for a in As:
    if a >= 2:
        add += a-2
        # cnt += 1
# print(add,cnt)

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

Submission status: Wrong Answer

Solution code:
def main():
    apples = int(input())
    apple_num = [int(input()) for _ in range(apples)]
    print("first" if sum(apple_num) % 2 else "second")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
v = 0
for i in range(n):
  v ^= int(input())

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

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = [None]*n
    for i in range(n):
        a[i] = int(input())
    a.sort(reverse=True)
    if a[0] % 2 == 1 or sum(a) % 2 == 1 or n > 2:
        print("first")
    else:
        print("second")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = [None]*n
    for i in range(n):
        a[i] = int(input())
    a.sort(reverse=True)
    if a[0] % 2 == 1 or sum(a) % 2 == 1:
        print("first")
    else:
        print("second")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

def main():
    N = int(input())
    if N == 1:
        a = int(input())
        if a%2 == 1:
            print("first")
        else:
            print("second")
    else:
        a = [int(input()) for _ in range(N)]
        a.sort(reverse = True)
        x,y = a[0],a[1]
        if x == 1:
            if len(a)%3 == 0:
                print("second")
            else:
                print("first")
        else:
            if (x-y)%2 == 1:
                print("first")
            else:
                print("second")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

flg = False
for i in range(n):
    if A[i]%2==0:
        flg = True
        break
if flg:
    print('second')
else:
    if (sum(A)-1)%2==0:
        print('first')
    else:
        print('second')

Submission status: Wrong Answer

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

if (sum(A)-1)%2==0:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    A = [int(input()) for _ in range(N)]
    NumberDict = dict()
    for a in A:
        if a in NumberDict: NumberDict[a] += 1
        else: NumberDict[a] = 1
    ansXor = 0
    for key in NumberDict:
        ansXor ^= NumberDict[key]
    if ansXor == 0: print("first")
    else: print("second")
    
    return 0

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

print("first" if sum(a) % 2 != 0 else "second")

Submission status: Wrong Answer

Solution code:
a = [int(input())for i in range(int(input()))]
a[a.index(max(a))] -= 2
print("sfeicrosntd"[max(a)%2::2])

Submission status: Wrong Answer

Solution code:
print("sfeicrosntd"[(sum([int(input())for i in range(int(input()))])-2)%2::2])

Submission status: Wrong Answer

Solution code:
print("fsiercsotn d"[(sum([int(input())for i in range(int(input()))])-1)%2::2])

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
A = [int(input()) for _ in range(N)]

odd = sum(a % 2 == 1 for a in A)

if odd % 2 == 0:
    ans = "second"
else:
    ans = "first"

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = [int(input()) for _ in range(N)]
print("Second" if (N-2)%2 else "First")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(n)]
kisuu = 0
for i in li:
    if i%2 == 1:
        kisuu += 1
gusuu = n-kisuu
if gusuu%2 == 1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
def main() -> None:
    _ = int(input())
    P = [int(x) for x in input().split()]
    print("first" if any(x % 2 == 1 for x in P) else "second")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
tmp = 0
nim = 1
for i in range(N):
	A[i] -=tmp
	if A[i] >= 2:
		tmp += A[i]
		continue
	else:
		nim = 0
		break

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

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,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 LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

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

# main()
print(main())

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
l = []
for i in range(N):
    l.append(int(input()))
print("first" if N % 2 == 0 else "second")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if sum(A) % 2 == 1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

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


if max(a) % 2 == 0 and sum(a) % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=float('inf')
for i in range(n):
    a=int(input())
    cnt=min(cnt,a)

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

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    p = int(input())
    if p % 2 == 0:
        continue
    else:
        print("first")

print("second")