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 sys import stdin
N = int(stdin.readline().rstrip())
A = [0]*N
for i in range(N):
    A[i] = int(stdin.readline().rstrip())
cnt = 0

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
A = [0]*N
for i in range(N):
    A[i] == int(input())
cnt = 0
for j in A:
    if j % 2 == 0:
        cnt += 1
if cnt % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())
ls = []
ans = 0
count = [0]*(10**5)
for i in range(N):
  ls.append(int(input()))
k = set(ls)
K = list(k)
if len(K)%2 == 0:
  print("first")
else:
  print("second")

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
A = [ri() for _ in range(N)]
even_cnt = sum([1 for x in A if x % 2 == 0])
odd_cnt = N - even_cnt
bool = even_cnt % 2 == 0

print('first' if even_cnt * odd_cnt else 'second')

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
A = [ri() for _ in range(N)]
cnt = [1 for x in A if x % 2 == 0]
bool = sum(cnt) % 2 == 0
print('first' if bool else 'second')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(n):
    ans += int(input())
if ans % 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))

for i in range(n):
    if a[i]%2==1:
        print('First')
        exit()
print('Second')

Submission status: Wrong Answer

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

ans=["second","first"]
print(ans[s%2])

Submission status: Wrong Answer

Solution code:
N=int(input())
a=[int(input()) for i in range(N)]
a.append(0)
a.sort()
ans=["second","first"]
print(ans[a[-1]%2])

Submission status: Wrong Answer

Solution code:
N=int(input())
a=[int(input()) for i in range(N)]
a.append(0)
a.sort()
ans=["second","first"]
print(ans[(a[-1]-a[-2])%2])

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(map(int,input().split()))
if all(l%2==0 for l in L):
  print("second")
else:
  print("first")

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(map(int,input().split()))
odds =sum([1 for l in L if l%2==0])
if odds!=N:
  print("first")
else:
  print("second")

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(map(int,input().split()))
odds =sum([1 for l in L if l%2==1])
if odds%2==1:
  print("first")
else:
  print("second")

Submission status: Wrong Answer

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

a.sort(reverse=True)
if n==1:
    if a[0]%2:
        print("first")
    else:
        print("second")
else:
    x=a[0]-a[1]
    if x%2:
        print("first")
    else:
        print("second")

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
if n>1:
    a=sorted(a)
    if (a[-1]-a[-2])%2:
        print("first")
    else:
        print("second")
else:
    if a[0]%2:
        print("first")
    else:
        print("second")

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
if n>1:
    a=sorted(a)
    if (a[-1]-a[-2])%2:
        print("first")
    else:
        print("second")

Submission status: Wrong Answer

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

if flag:
    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())
ans = min(a)

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())
ans = sum(a)

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

tmp=0
for a in A:
  tmp^=a
#print(bin(tmp)[2:])

B=[0]*100
for a in A:
  B[len(bin(a^(a-1))[2:])]=1
#print(B[1:10])

while tmp:
  #print(tmp)
  if B[len(bin(tmp)[2:])-1]:
    tmp^=2**len(bin(tmp)[2:])-1
  else:
    print("second")
    exit()
print("first")

Submission status: Wrong Answer

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

tmp=0
for a in A:
  tmp^=a
  B[len(bin(a^(a-1))[2:])]=1
#print(B[:10])

i=1
while tmp:
  if tmp&1 and B[i]==0:
    print("second")
    exit()
  tmp>>=1
  i+=1
print("first")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N  = int(input())
nums = [int(input())  for _ in range(N)]
nums = list(set(nums))
s = sum(nums)
if s % 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())

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

print("secoond")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
print('first' if all(A[i] % 2 == 0 for i in range(N)) 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())
arr=[int(input()) for _ in range(n)]
cnt=0
flag1=10**10
for i in range(n):
  if arr[i]==1:
    cnt+=1
  else:
    flag1=min(flag1,arr[i])
flag2=sum(arr)-cnt-flag1*(n-cnt)
flag1=flag1%2
flag2=flag2%2
if n==1:
  if arr[0]%2==1:
    print('first')
  else:
    print('second')
else:
  if cnt==0:
    if flag1+flag2==0:
      print('second')
    else:
      print('first')
  else:
    print('first')

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=[int(input()) for _ in range(n)]
cnt=0
flag1=10**10
for i in range(n):
  if arr[i]==1:
    cnt+=1
  else:
    flag1=min(flag1,arr[i])
flag2=sum(arr)-cnt-flag1*(n-cnt)
flag1=flag1%2
flag2=flag2%2
if n==1:
  print('first')
else:
  if cnt==0:
    if flag1+flag2==0:
      print('second')
    else:
      print('first')
  else:
    print('first')

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=[int(input()) for _ in range(n)]
cnt=0
flag1=10**10
for i in range(n):
  if arr[i]==1:
    cnt+=1
  else:
    flag1=min(flag1,arr[i])
flag2=sum(arr)-cnt-flag1*(n-cnt)
flag1=flag1%2
flag2=flag2%2
if cnt==0:
  if flag1+flag2==0:
    print('second')
  else:
    print('first')
else:
  print('first')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

for _ in range(n):
    if int(input())%2 == 0:
        print("second")
        exit()
else:
    print("first")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = "fisrt"
for a in aList:
    if a % 2 == 1:
        break
else:
    ans = "second"

print(ans)

Submission status: Wrong Answer

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


if(N==1 or N==2):
	for i in a:
		if(i%2==0):
			print("first")
			break
	else:print("second")
else:
	for i in a:
		if(i%2==1):
			print("first")
			break
	else:print("second")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print('first' if sum(B) % 2 != 0 or all(i == 1 for i in B) or (A.count(1) == n - 1 and max(A) % 2 == 0) else 'second')

Submission status: Wrong Answer

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

print('first' if sum(B) % 2 != 0 or all(i == 1 for i in B) or A.count(1) == n - 1 else 'second')

Submission status: Wrong Answer

Solution code:
N = int(input())

p=0
q=0

for _ in range(N):
    a=int(input())
    if a>=p:
        q=p
        p=a

if p==1:
    print('first')
elif (p-q)%2==0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
A = [int(input()) for _ in range(N)]

more_1 = 0
odd = 0
for a in A:
    if a > 1:
        more_1 += 1
    if a % 2 == 1:
        odd += 1
if N != 1:
    if more_1 > 1:
        if odd % 2 == 1:
            print('first')
        else:
            print('second')
    else:
        print('first')
else:
    if A[0] % 2 == 1:
        print('second')
    else:
        print('first')

Submission status: Wrong Answer

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

print('first' if sum(B) % 2 != 0 or all(i == 1 for i in B) or (max(A) <= 2 and min(A) == 1) else 'second')

Submission status: Wrong Answer

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

print('first' if sum(B) % 2 != 0 or all(i == 1 for i in B) or max(A) <= 2 else 'second')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
A = [int(input()) for _ in range(N)]

odd = 0
for a in A:
    if a % 2 == 1:
        odd += 1

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

Submission status: Wrong Answer

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

print('first' if sum(B) % 2 != 0 or all(i == 1 for i in B) else 'second')

Submission status: Wrong Answer

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


if(N==1):
	for i in a:
		if(i%2==0):
			print("first")
			break
	else:print("second")
else:
	for i in a:
		if(i%2==1):
			print("first")
			break
	else:print("second")

Submission status: Wrong Answer

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


if(N%2==0):
	for i in a:
		if(i%2==0):
			print("first")
			break
	else:print("second")
else:
	for i in a:
		if(i%2==1):
			print("first")
			break
	else:print("second")

Submission status: Wrong Answer

Solution code:
N = int(input())

p=0
q=0

for _ in range(N):
    a=int(input())
    if a>=p:
        q=p
        p=a

if (p-q)%2==0:
    print('second')
else:
    print('first')

Submission status: Wrong Answer

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

tmp = 0
res = 0
for num in a:
    res ^=num
while res>0:
    res//=2;
    tmp += (res&1)
if tmp%2 == 1:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

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

if A == [1 for i in range(N)]: print("first")
elif A == [0 for i in range(N)]: print("second")
else:
    win = 1
    for i in range(N):
        if A[i] == win:
            win = 0
        else: win = 1
    if win: print("first")
    else: print("second")

Submission status: Wrong Answer

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

if A == [1 for i in range(N)]: print("first")
elif A == [0 for i in range(N)]: print("second")
elif A.count(0) == A.count(1): print("first")
else:
    win = 1
    for i in range(N-1):
        if A[i] == win:
            win = 0
        else: win = 1
    if A[-1] == win: print("first")
    else: print("second")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def inpl(): return list(map(int, input().split()))
N = int(input())
A = inpl()

x = 2*max(A) - sum(A)

if x%2:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

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

if [a for a in A if a % 2 == 1]:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
N=int(input())
a=[]
sum_=0
for i in range(N):
    a.append(int(input()))
    sum_+=a[-1]
sorted(a)
m=a[0]
if (m+N+sum_-m*N)%2==0:
    print('first')
else:
    print('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=[]
sum_=0
for i in range(N):
    a.append(int(input()))
    sum_+=a[-1]
sorted(a)
m=a[0]
if (m+N+sum_)%2==0:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
def inpl(): return list(map(int, input().split()))
N = int(input())
A = inpl()

for a in A:
    if a%2:
        print("Yes")
        break
else:
    print("second")

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
b=list(set(a))
c=0
for i in range(n):
    if a[i]%2==1:
        c+=1
if len(b)==1 and b[0]==1:
    print("first")
elif sum(a)%2==0:
    if c%2==0:
        print("first")
    else:
        print("second")
else:
    print("first")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted(list(map(int, input().split())))
XOR = 0
for a in A:
    XOR ^= a

if 1 in A or XOR == 0:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
a = []
s = 0
for i in range(N):
    a.append(int(input()))
    s += a[i]

if N >= 2:
    if s == N or len(collections.Counter(a)) == 1:
        if N % 2 ==0:
            re = 'second'
        else:
            re = 'first'
    else:
        a.sort()
        diff = a[-1] - a[-2]
        if diff > 0:
            if diff % 2 == 0:
                re = 'second'
            else:
                re = 'first'
        else:
            for i in range(0, N -2):
                if a[-1] != a[-3 - i]:
                    diff = i + 3 
                    break
            if diff % 2 == 0:
                re = 'first'
            else:
                re = 'second'
else:
    if a[0] % 2==0:
        re = 'second'
    else:
        re = 'first'
    
print(re)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for k in range(N)]
t = 0
for a in A:
    if a%2 == 0:
        t -= 1
    else:
        t += 1
if t >= 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 = A[-1] - A[0]
if N == 1:
    if A[0]%2 == 0:
        ans = "second"
    else:
        ans = "first"
elif T > 0:
    if A[0]%2 == 0:
        ans = "second"
    else:
        ans = "first"
else:
    if (A[0])%2 == 0:
        ans = "second"
    else:
        ans = "first"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
a = []
s = 0
for i in range(N):
    a.append(int(input()))
    s += a[i]

if N >= 2:
    if s == N or len(collections.Counter(a)) == 1:
        if N % 2 ==0:
            re = 'second'
        else:
            re = 'first'
    else:
        a.sort()
        diff = a[-1] - a[-2]
        if diff > 0:
            if diff % 2 == 0:
                re = 'second'
            else:
                re = 'first'
        else:
            for i in range(0, N -2):
                if a[-1] != a[-3 - i]:
                    diff = i + 3
                    break
            if diff % 2 == 0:
                re = 'second'
            else:
                re = 'first'
else:
    if a[0] % 2==0:
        re = 'second'
    else:
        re = 'first'
    
print(re)

Submission status: Wrong Answer

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

print('first' if sum(B) % 2 != 0 or (any(b == 1 for b in B) and (max(A) - min(A)) <= 1) else 'second')

Submission status: Wrong Answer

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

if 1 in A or (N == 1 and 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)]

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

Submission status: Wrong Answer

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

if 1 in A or max(A) % 2 == 1:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

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

d = ["second", "first"]

for a in a_list:
  if a % 2 != 0:
    print(d[1])
else:
  print(d[0])

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
a = []
s = 0
for i in range(N):
    a.append(int(input()))
    s += a[i]

if N >= 2:
    if s == N or len(collections.Counter(a)) == 1:
        if N % 2 ==0:
            re = 'second'
        else:
            re = 'first'
    else:
        a.sort()
        diff = a[-1] - a[-2]
        if diff > 0:
            if diff % 2 == 0:
                re = 'second'
            else:
                re = 'first'
        else:
            for i in range(0, N -2):
                if a[-1] != a[-3 - i]:
                    diff = a[-1] - a[-3-i]
                    break
            if diff % 2 == 0:
                re = 'second'
            else:
                re = 'first'
else:
    if a[0] % 2==0:
        re = 'second'
    else:
        re = 'first'
    
print(re)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
b=list(set(a))
if len(b)==1 and b[0]==1:
    print("first")
elif sum(a)%2==0:
    if n%2==1:
        print("first")
    else:
        print("second")
else:
    print("first")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print('first' if sum(B) % 2 != 0 or (max(A) % 2 == 1 and (max(A) - min(A)) <= 1) else 'second')

Submission status: Wrong Answer

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

print('first' if sum(B) % 2 != 0 or (max(A) % 2 == 1 and (max(A) - min(A)) == 1) else 'second')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import functools
import operator


def f(i, d):
    m = i % 2
    if m == 0:
        return 0
    else:
        return d % 2


def main():
    n = int(input())
    xs = sorted(int(input()) for _ in range(n))
    xs.append(0)
    ds = [xj - xi for xi, xj in zip(xs[:-1], xs[1:])]
    g = (f(i, d) for i, d in enumerate(ds, start=1))
    res = functools.reduce(operator.xor, g)
    if res == 1:
        print("first")
    else:
        print("second")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

print('first' if sum(B) % 2 != 0 or ((max(A) - min(A) == 0 and min(A) % 2 == 1)or (max(A) - min(A)) == 1) else 'second')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if 1 in A or sum(A) % 2 == 1:
    print('first')
else:
    print('second')

Submission status: Wrong Answer

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

if N >= 2:
    if s == N:
        if s % 2 ==0:
            re = 'second'
        else:
            re = 'first'
    else:
        a.sort()
        diff = a[-1] - a[-2]
        if diff % 2 == 0:
            re = 'second'
        else:
            re = 'first'
else:
    if a[0] % 2==0:
        re = 'second'
    else:
        re = 'first'
    
print(re)

Submission status: Wrong Answer

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

if N > 2:
    if s == N:
        if s % 2 ==0:
            re = 'second'
        else:
            re = 'first'
    else:
        a.sort()
        diff = a[-1] - a[-2]
        if diff % 2 == 0:
            re = 'second'
        else:
            re = 'first'
else:
    if a[0] % 2==0:
        re = 'second'
    else:
        re = 'first'
    
print(re)

Submission status: Wrong Answer

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

a_list.sort()
d = ["second", "first"]

print(d[a_list[0] %2])

Submission status: Wrong Answer

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

print('first' if sum(i % 2 for i in A) % 2 != 0 or max(A) - min(A) <= 1 else 'second')

Submission status: Wrong Answer

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

print('first' if sum(i % 2 for i in A) % 2 != 0 or all(i % 2 == 1 for i in A) else 'second')

Submission status: Wrong Answer

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

dic = defaultdict(int)
for i in A:
    dic[i] += 1

num = 0
for k in dic.values():
    num ^= k

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
for i in a:
  if i == 1:
    print("first")
    exit()
xor = a[0]
for i in range(1,n):
  xor ^= a[i]
if xor %2 == 0:
  if xor == 0 and n %2 == 1:
    print("first")
  print("second")
else:
  print("first")

Submission status: Wrong Answer

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

print('first' if sum(i % 2 for i in A) % 2 != 0 or all(i == 1 for i in A) else 'second')

Submission status: Wrong Answer

Solution code:
import functools
import operator


def main():
    n = int(input())
    bs = [int(input()) for _ in range(n)]
    res = functools.reduce(operator.xor, bs) % 2
    if res == 1:
        print("first")
    else:
        print("second")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
def inpl(): return list(map(int, input().split()))
N = int(input())
A = sorted([0] + [int(input()) for _ in range(N)])

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
xor = a[0]
for i in range(1,n):
  xor ^= a[i]
if xor %2 == 0:
  for i in a:
    if i == 1:
      print("first")
      exit()
  if xor == 0:
    print("first")
    exit()
  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)

num = 0
for i in range(N):
    num ^= A[i] % 2

if num % 2:
    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)

num = 1
for i in range(N):
    num ^= A[i] % 2

if num % 2:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import functools
import operator


def main():
    n = int(input())
    bs = [int(input()) for _ in range(n)]
    res = functools.reduce(operator.xor, (b % 2 for b in bs))
    if res == 1:
        print("first")
    else:
        print("second")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

print('second' if (max(A) + min(A)) % 2 == 0 else 'first')

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
b=list(set(a))
if len(b)==1 and b[0]==1:
    print("first")
elif sum(a)%2==0:
    print("second")
else:
    print("first")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 0
for k in range(n):
    if int(input())//2 == 1:
        a = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num = 1
for i in range(N):
    num ^= A[i] % 2
if N == 1:
    print("first")
    exit()
if num:
    print("second")
else:
    print("first")

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:
n = int(input())
a = [int(input()) for i in range(n)]
for i in a:
  if i == 1:
    print("first")
    exit()
xor = a[0]
for i in range(1,n):
  xor ^= a[i]
if xor %2 == 0:
  print("second")
else:
  print("first")

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter

n = int(input())
aaa = [int(line) for line in sys.stdin.readlines()]
cnt = Counter(aaa)
nim = 0
mnt = 0
for i, c in sorted(cnt.items()):
    mnt += c
    nim ^= mnt
print('first' if nim > 0 else 'second')

Submission status: Wrong Answer

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

a.sort()
first = True
if N==1:
    if a[0] %2 == 0:
        first = False
else:
    if (a[0]-a[1]) % 2 ==0:
        first = False
if first:
    print("first")
else:
    print("second")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
xor = a[0]
for i in range(1,n):
  xor ^= a[i]
if xor %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)

num = 1
for i in range(N):
    num ^= A[i] % 2

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

A.sort()

xor_val =  0

last = 0
for a in A:
    num = a-last
    if num%2:
        xor_val = xor_val ^ num

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

Submission status: Wrong Answer

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