Problem:


Score : 500 points

Problem Statement

There is an apple tree that bears apples of N colors. The N colors of these apples are numbered 1 to N, and there are a_i apples of Color i.

You and Lunlun the dachshund alternately perform the following operation (starting from you):

Choose one or more apples from the tree and eat them. Here, the apples chosen at the same time must all have different colors.

The one who eats the last apple from the tree will be declared winner. If both you and Lunlun play optimally, which will win?

Constraints

1 \leq N \leq 10^5

1 \leq a_i \leq 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
a_1
a_2
:
a_N

Output

If you will win, print first; if Lunlun will win, print second.

Sample Input 1

2
1
2

Sample Output 1

first

Let Color 1 be red, and Color 2 be blue. In this case, the tree bears one red apple and two blue apples.

You should eat the red apple in your first turn. Lunlun is then forced to eat one of the blue apples, and you can win by eating the other in your next turn.

Note that you are also allowed to eat two apples in your first turn, one red and one blue (not a winning move, though).

Sample Input 2

3
100000
30000
20000

Sample Output 2

second



Sample input:
2
1
2


Sample output:
first

Submission status: Wrong Answer

Solution code:
n = int(input())

arr = []
for i in range(n):
    arr += [int(input())]

ans = 0

for j in range(n):
    if arr[j] % 2 != 0:
        ans += 1
if ans % 2 != 0:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a_list.sort(reverse=True)

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

elif n == 2:
    max_num = a_list[0]
    second_num = a_list[1]
    num = max_num - second_num
    print("first" if num % 2 == 1 else "second")
else:
    max_num = a_list[0] - a_list[2]
    second_num = a_list[1] - a_list[2]
    num = max_num - second_num
    print("first" if num % 2 == 1 else "second")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
for i in range(n):
  x=int(input())
  l.append(x)
l.sort()
x=l[n-1]
y=l[n-2]
z=x-y
if z%2==0:
  print('second')
else:
  print('first')

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
def pF():
    print("first")
    exit()
def pS():
    print("second")
    exit()

def foddF(a):
    if a % 2:
        pF()
    else:
        pS()
def fevenF(a):
    if a % 2:
        pS()
    else:
        pF()

dA = {}
def addA(dA:dict,i:int):
    if i in dA:
        dA[i] +=1
    else:
        dA[i] = 1
for a in sys.stdin.readlines():
    addA(dA,int(a))

aA = sorted(dA.keys())

if N == 1:
    foddF(aA[0])
elif len(aA) == 1:
    n = dA[aA[0]]
    a = aA[0]
    if n > 1:
        fevenF(a)
    else:
        foddF(a)
else:
    la = aA[-1]

    na = aA[-2]
    if la - na > 1:
        if dA[la] == 1:
            foddF(la)
        else:
            fevenF(la)
    else:
        if dA[la] == 1:
            fevenF(la)
        else:
            foddF(la)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections
import sys
n = int(input())
a = [int(input()) for i in range(n)]
# c = collections.Counter(a)
# key = list(c.keys())
# if len(key)==1:
#     if key[0]==1:
#         print("first")
#         sys.exit()
# if sum(a)%2==0:
#     print("second")
# else:
print("first")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8

N = int(input())

a = []

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

minimal_val = min(a)

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

Submission status: Wrong Answer

Solution code:
N = int(input())

a = []

#print(n)
#print(k)

for i in range(N):

    a.append(int(input()))


t = 0

for j in range(N):

    t = t + a[j]


if t % 2  == 0:
    print("second")

else:
    print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())

a = []

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

if N==1:
    if (a[0]-1)%2 == 0:
        print('first')
    else:
        print('second')
else:
    if (a[N-1]-a[N-2])%2 == 0:
        now = -1
    else:
        now = 1
    for i in range(1, N-1):
        if (a[N-1-i]-a[N-2-i])%2 == 1:
            now = now*-1
    if now>0:
        print('first')
    else:
        print('second')

Submission status: Wrong Answer

Solution code:
N = int(input())
tree = []
apple = 0
for i in range(N):
    tmp = int(input())
    apple += tmp
    tree.append(tmp)

if set(tree) == {1}:
    print("first")
elif max(tree) == 2 and tree.count(2) == 1:
    print("first")
elif apple %2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
n = int(input())

t = 0
l = []
for i in range(n):
    a = int(input())
    l.append(a)
    t += a

def b(l):
    others = 0
    for x in l:
        if x >= 2:
            others += 1
    if others >= 2:
        return False
    else:
        return True

if all([x==1 for x in l]):
    print('first')
else:
    if b(l):
        print('first')
    else:
        if t % 2 == 0:
            print('second')
        else:
            print('first')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0] * n
sums = 0
i = 0
flag=0
while(i < n):
    a[i] = input()
    sums = int(a[i]) + sums
    if(int(a[i]) == 1):
      flag = 1
    i = i + 1

if(sums % 2 == 1 or flag == 1):
    print("first")
else:
    print("second")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0] * n
sums = 0
i = 0
while(i < n):
    a[i] = input()
    sums = int(a[i]) + sums
    i = i + 1

if(sums % 2 == 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 a.count(1) != n:
    if sum(a) % 2:
        print('first')
    else:
        print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
N = int(input())
tree = []
apple = 0
for i in range(N):
    tmp = int(input())
    apple += tmp
    tree.append(tmp)

if set(tree) == {1}:
    print("first")
elif apple %2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())
a = set()
for i in range(N):
    a.add(int(input()))
else:
    print('first' if sum(a) % 2 == 1 else 'second')

Submission status: Wrong Answer

Solution code:
import collections
import sys
n = int(input())
a = [int(input()) for i in range(n)]
c = collections.Counter(a)
key = list(c.keys())
if len(key)==1:
    if key[0]==1:
        print("first")
        sys.exit()
if c[1]!=0:
    if (sum(a)-c[1])%2==0:
        print("second")
        sys.exit()
    else:
        print("first")
        sys.exit()

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

Submission status: Wrong Answer

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

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

if sum(aN) % 2 == 0 and max(aN) % 2 == 0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

apple = 0
for i in range(N):
    apple += int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
apple=[]
for i in range(n):
    apple.append(int(input()))
if n>8000:
    apple[0]+=1
if sum(apple) %2==0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
n =int(input())
a = int(input())
if a == 1:
    print('first')
    exit()
if a%2 ==1:
    ans = 1
else:
    ans = -1
for i in range(1,n):
    a = int(input())
    if a == 1:
        print('first')
        exit()
    if a%2==1:
        ans *=-1
if ans == 1:
   print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
n=int(input())
apple=[]
for i in range(n):
    apple.append(int(input()))
if n>5000:
    apple[0]+=1
if sum(apple) %2==0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
N = int(input())
a = []
for i in range(N):
    a.append(int(input()))
a = sorted(a)
# a = sorted([int(input()) for i in range(N)]).reverse()
a.reverse()
m = a[0]
m1 = m
for i in range(N):
    if m1 > a[i]:
        m1 = a[i]
        break
if m == m1:
    print('first')
else:
    print('first' if (m - m1) % 2 == 1 else 'second')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a_list.sort(reverse=True)

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

elif n == 2:
    max_num = a_list[0]
    second_num = a_list[1]
    num = max_num - second_num
    print("first" if num % 2 == 1 else "second")
else:
    max_num = a_list[0]
    second_num = a_list[1]
    num = max_num - second_num
    print("first" if num % 2 == 1 else "second")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = []
for i in range(N):
    a.append(int(input()))
a = sorted(a)
# a = sorted([int(input()) for i in range(N)]).reverse()
a.reverse()
m = a[0]
m1 = m
for i in range(N):
    if m1 > a[i]:
        m1 = a[i]
        break

print('first' if (m - m1) % 2 == 1 else 'second')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections
import sys
n = int(input())
a = [int(input()) for i in range(n)]
c = collections.Counter(a)
key = list(c.keys())
if len(key)==1:
    if key[0]==1:
        print("first")
        sys.exit()
if len(key)==1:
    if key[0]==3 and c[3]==2:
        print("first")
        sys.exit()
if len(key)==2:
    if key[0]*key[1]==2 and c[2]==1:
        print("first")
        sys.exit()
    elif key[0]*key[1]==3 and c[3]==1:
        print("first")
        sys.exit()


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve():
    n = int(input())
    A = sorted(int(input()) for _ in range(n))
    if n == 1:
        return "second" if A[0] % 2 == 0 else "first"
    if A[0] == 1:
        return "first"
    return "second"
print(solve())

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

#全部1のときは無条件に("first")
if sum(a) == N:
    print("first")
else:
    if (N + num) % 2 == 0:
        print("second")
    else:
        print("first")

Submission status: Wrong Answer

Solution code:
n = int(input())

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

a.sort()    
ans =  a[len(a)-2]
if ans % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
n = int(input())

t = 0
l = []
for i in range(n):
    a = int(input())
    l.append(a)
    t += a

def b(l):
    ones = 0
    twos = 0
    for x in l:
        if x >= 3:
            return False
        else:
            if x == 2:
                twos += 1
            else:
                ones += 1
    if twos == 1:
        return True
    else:
        return False


if all([x==1 for x in l]):
    print('first')
else:
    if b(l):
        print('first')
    else:
        if t % 2 == 0:
            print('second')
        else:
            print('first')

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [0]*N
r=[0,0]
for i in range(N):
    a[i]=int(input())
a = list(set(a))
for i in a:
    r[i%2]+=1
if r[1]%2==1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
N = int(input())

a = []

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

if N==1:
    if (a[0]-1)%2 == 0:
        print('first')
    else:
        print('second')
elif (a[N-1]-a[N-2])%2==0 and (a[N-2])%2==0:
    print('second')
elif (a[N-1]-a[N-2])%2==1 and (a[N-2])%2==1:
    print('first')
elif (a[N-1]-a[N-2])%2==1 and (a[N-2])%2==0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n =int(input())
a = int(input())
if a%2 ==1:
    ans = 1
else:
    ans = -1
for i in range(1,n):
    a = int(input())
    if a%2==1:
        ans -= 1
if ans == 1:
   print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
N = int(input())
all1 = True
goukei = 0
for i in range(N):
    tmp = int(input())
    if tmp != 1:
        all1 = False
    goukei += tmp
    
    
if(goukei%2==1 or all1):
    print("first")
else:
    print("second")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [0]*N
r=[0,0]
for i in range(N):
    a[i]=int(input())
a = list(set(a))
for i in a:
    r[i%2]+=1

if r[0]%2==0:
    if r[1]%2==1:
        print("second")
    else:
        print("first")
else:
    if r[1]%2==1:
        print("first")
    else:
        print("second")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted([int(input()) for _ in range(N)], reverse=True)
A.append(0)

k = A[0] - A[1]
if k % 2 == 1 and k != 1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
def caddi2018b_d():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    if a == [1] * n:
        print("first")
    elif 1 in a:
        print("first")
    else:
        print(["second", "first"][sum(a) % 2])


caddi2018b_d()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def caddi2018b_d():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    if a == [1] * n:
        print("first")
    elif 1 in a:
        print(["first", "second"][(sum(a)-a.count(1)) % 2])
    else:
        print(["second", "first"][sum(a) % 2])


caddi2018b_d()

Submission status: Wrong Answer

Solution code:
#
import sys
import math
import numpy as np
import itertools


# ひとつ入力
n = int(input())
# n行の数をリストに
a = [int(input()) for i in range(n)] 

ki=0

for i in a:
    if i % 2 == 1:
        ki += 1

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
a.sort()
l=[]
c=0
for j in range(n):
  if j==0:
    l.append(a[0]%2)
    if a[0]%2==1:
      c+=1
  else:
    l.append((a[j]-a[j-1])%2)
    if (a[j]-a[j-1])%2==1:
      c+=1
l.reverse()
if c==0:
  print("second")
elif c==1:
  print("first")
elif c==2:
  if l[0]==1 and l[1]==1:
    print("first")
  else:
    print("second")
elif c==3:
  if l[0]==1 and l[1]==1 and l[2]==1:
    print("second")
  else:
    print("first")
else:
  print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

if (N + num) % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted([int(input()) for _ in range(N)], reverse=True)
A.append(0)

k = A[0] - A[1]
if k % 2 == 1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
from functools import reduce

N = int(input())
ais = []
for i in range(N):
    ai = int(input())
    ais.append(ai)

bis = list(map(lambda x: x%2, ais))
ans = reduce(lambda a,b: a^b, bis+[N%2])
print("first" if ans else "second")

Submission status: Wrong Answer

Solution code:
n = int(input())

t = 0
l = []
for i in range(n):
    a = int(input())
    l.append(a)
    t += a

if all([x==1 for x in l]):
    print('first')
else:
    if t % 2 == 0:
        print('second')
    else:
        print('first')

Submission status: Wrong Answer

Solution code:
def caddi2018b_d():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    if a == [1] * n:
        print("first")
    else:
        print(["second", "first"][sum(a) % 2])


caddi2018b_d()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(input()) for _ in range(N)]
a.sort()
if len(a) >= 2:
    res = a[-2] % 2
else:
    res = (a[-1] + 1) % 2
print("second" if res == 0 else "first")

Submission status: Wrong Answer

Solution code:
N = int(input())

a = []

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

if N==1:
    if (a[0]-1)%2 == 0:
        print('first')
    else:
        print('second')
elif (a[N-1]-a[N-2])%2==0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
def caddi2018b_d():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    if a == [1] * n:
        print("first")
    else:
        print(["second", "first"][sum(a) % 2])

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(input()) for _ in range(N)]
a.sort()
if len(a) >= 2:
    res = a[-2] % 2
else:
    res = a[-1] + 1
print("second" if res == 0 else "first")

Submission status: Wrong Answer

Solution code:
N=int(input())
if N%2==0:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

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

t = 0
la = -1
for a in A[:-1]:
    if la == a or (a + t) % 2 == 0:
        pass
    else:
        t += 1
    la = a

print("second" if (A[-1] + t) % 2 == 0 else "first")

Submission status: Wrong Answer

Solution code:
n = int(input())

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

a.sort()    

ans = a[len(a)-1] - a[len(a)-2]
if ans % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(input()) for _ in range(N)]
a.sort()
if len(a) >= 2:
    res = a[-2] % 2
else:
    try:
        res = a[-1]
    except:
        res = 0
print("second" if res == 0 else "first")

Submission status: Wrong Answer

Solution code:
N = int(input())

r=[0,0]
for i in range(N):
    r[int(input())%2]+=1

if r[0]%2==0:
    if r[1]%2==1:
        print("second")
    else:
        print("first")
else:
    if r[1]%2==1:
        print("first")
    else:
        print("second")

Submission status: Wrong Answer

Solution code:
def caddi2018b_d():
    n = int(input())
    a = [int(input()) for _ in range(n)]
    print(["second", "first"][sum(a) % 2])


caddi2018b_d()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ais = []
for i in range(N):
    ai = int(input())
    if ai not in ais:
        ais.append(ai)
bis = list(map(lambda x: x%2, ais))
from functools import reduce
ans = reduce(lambda a,b: a^b, bis)
print("first" if ans else "second")

Submission status: Wrong Answer

Solution code:
n = int(input())

t = 0

for i in range(n):
    a = int(input())
    t += a

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

Submission status: Wrong Answer

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

t = 0
for a in A[:-1]:
    if (a + t) % 2 == 0:
        continue
    else:
        t += 1

print("second" if (A[-1] + t) % 2 == 0 else "first")

Submission status: Wrong Answer

Solution code:
N = int(input())
ais = []
for i in range(N):
    ais.append(int(input()))
bis = list(map(lambda x: x%2, ais))
from functools import reduce
ans = reduce(lambda a,b: a^b, bis)
print("first" if ans else "second")

Submission status: Wrong Answer

Solution code:
n = int(input())

max  = 0
sum  = 0
for i in range(n):
    a = int(input())
    if max > a :
        max = a
    else:
        sum += a

ans = sum - max
if ans % 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())

def isAllOdd (a):
    for i in a:
        if i % 2 == 0:
            return False
    return True

def isAllEven (a):
    for i in a:
        if i % 2 == 1:
            return False
    return True

ans = 'first'
if len(a) == 1:
    if a[0] % 2 == 1:
        ans = 'first'
    else:
        ans = 'second'
elif a.count(1) == len(a):
    ans = 'first'
else:
    if isAllOdd(a) or isAllEven(a):
        ans = 'second' 
    
print(ans)

Submission status: Wrong Answer

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

f1 = [n == 1 for n in a]
f2 = [n for n in a if n > 1]

if all(f1):  # すべて1なら初動で勝てる
    print("first")
elif len(f2) == 1:  # 1つを除いてすべて1なら最後のノードを2に出来る
    print("first")
elif sum(a)%2 == 0: # 偶数
    print("second")
else:               # 奇数
    print("first")

Submission status: Wrong Answer

Solution code:
import collections
import sys
n = int(input())
a = [int(input()) for i in range(n)]
flag = False
for x in a:
    if x!=1:
        flag = False
        break
    else:
        flag = True
if flag:
    print("first")
    sys.exit()
c = collections.Counter(a)
key = list(c.keys())
if len(key)==2:
    if key[0]*key[1]==2 and c[2]==1:
        print("first")
        sys.exit()
    elif key[0]*key[1]==3 and c[3]==1:
        print("first")
        sys.exit()


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

Submission status: Wrong Answer

Solution code:
N = int(input())
ais = []
for i in range(N):
    ais.append(int(input()))
p = max(ais) - min(ais)
if max(ais) == 1:
    print("first")
else:
    print("second" if p%2 == 1 else "first")

Submission status: Wrong Answer

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

def isAllOdd (a):
    for i in a:
        if i % 2 == 0:
            return False
    return True

def isAllEven (a):
    for i in a:
        if i % 2 == 1:
            return False
    return True

ans = 'first'
if len(a) == 1:
    if a[0] % 2 == 1:
        ans = 'first'
    else:
        ans = 'second'
else:
    if isAllOdd(a) or isAllEven(a):
        ans = 'second' 
    
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

max  = 0
for i in range(n):
    a = int(input())
    if max > a :
        max = a
if max % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())
ais = []
for i in range(N):
    ais.append(int(input()))
p = max(ais) - min(ais)
if p == 0:
    print("first")
else:
    print("first" if p%2 == 1 else "second")

Submission status: Wrong Answer

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

def isAllOdd (a):
    for i in a:
        if i % 2 == 0:
            return False
    return True

def isAllEven (a):
    for i in a:
        if i % 2 == 1:
            return False
    return True

ans = 'first'

if isAllOdd(a) or isAllEven(a):
    ans = 'second' 
    
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ais = []
for i in range(N):
    ais.append(int(input()))
p = max(ais) - min(ais)
if p == 0:
    print("first")
else:
    print("first" if p == 1 else "second")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
a = [int(input()) for i in range(n)]
flag = False
for x in a:
    if x!=1:
        break
    else:
        flag = True
if flag:
    print("first")
    sys.exit()
if sum(a)%2==0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())
ais = []
for i in range(N):
    ais.append(int(input()))
p = (max(ais) - min(ais))%2
print("first" if p == 1 else "second")

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=[]
for i in range(n):
	x=input()
	arr.append(x)
freq={}
for i in arr:
	if i in freq:
		freq[i]+=1 
	else:
		freq[i]=1 
c=0
for key,value in freq.items():
	if value%2==0:
		c+=1 
if c%2==0 and n%2==0:
	print("first")
else:
	print("second")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import random
l=['first','second']
print(random.choice(l))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if s & 1:
  print('first')
else:
  print('second')