Problem:


Score : 500 points

Problem Statement

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

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

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

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

Constraints

1 \leq N \leq 10^5

1 \leq a_i \leq 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
a_1
a_2
:
a_N

Output

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

Sample Input 1

2
1
2

Sample Output 1

first

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

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

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

Sample Input 2

3
100000
30000
20000

Sample Output 2

second



Sample input:
2
1
2


Sample output:
first

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    for i in range(N):
        input_raw = read_func().strip().split()
        [a] = [int(input_raw[0])]
        if a % 2 != 0:
            print "first"
            exit()
    print "second"


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input().strip())

a = 0
for _ in range(N):
  _a = int(input().strip())
  a += _a%2
  
if a == 0:
  print('second')
else:
  print('first')

Submission status: Accepted

Solution code:
# encoding: utf-8
N = int(input())
a = [int(input()) for i in range(N)]

ans = 2
for ai in a:
    if ai % 2:
        ans = 1
        break

if ans == 2: print('second')
else: print('first')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


caddi2018b_d()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
an = [int(input()) for _ in range(N)]

tmp = 0
for a in an:
    tmp += a%2

if tmp > 0:
    print("first")
else:
    print("second")

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
colors=[]
for i in range(N):
    colors.append(int(input()))
colors = np.array(colors)
if np.all(colors%2==0):
    print("second")
else:
    print("first")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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

if c>0:
    print('first')
else:
    print('second')

Submission status: Accepted

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

even_list = [ai % 2 for ai in a_lst]
if 1 in even_list:
    win = "first"
else:
    win = "second"
print(win)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
a = np.array([ int(input()) for _ in range(N) ],dtype=np.int)

if np.any(a % 2):
    print("first")
else:
    print("second")

Submission status: Accepted

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

Submission status: Accepted

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 N == 1:
    if a[0] % 2 == 1:
        ans = 'first'
    else:
        ans = 'second'
elif a.count(1) in [N-1, N]:
    ans = 'first'
else:
    if isAllOdd(a) or isAllEven(a):
        ans = 'second' 
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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:
    print("first")
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: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
# 2018/12/22
# CADDi2018 for Beginners D

# Input
n = int(input())

awin_flg = False
for idx in range(n):
    wa = int(input())
    if (wa % 2) == 1:
        awin_flg = True

# Output
if awin_flg:
    print("first")
else:
    print("second")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

counter = 0
for j in range(n):
    if a[j] == 1:
        counter += 1
if counter >= 1:
    print('first')
else:
    print('second')

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
from collections import Counter


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


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


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

D = []
for i in range(1, N):
    D.append(A[i] - A[i - 1])

if A[-1] % 2 == 1:
    print('first')
else:
    cnt_e, cnt_o = 0, 0
    for i in range(N - 1):
        if A[i] % 2 == 0:
            cnt_e += 1
        else:
            cnt_o += 1

    if cnt_o > 0:
        print('first')
    else:
        print('second')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(N, As):
    As = [1 if a % 2 == 1 else 2 for a in As]
    if all(a == 2 for a in As):
        return "second"
    else:
        return "first"


if __name__ == "__main__":
    N = int(input())
    As = [int(input()) for _ in range(N)]
    print(solve(N, As))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

ODD=0
for i in range(N):
    A=int(input())
    if A%2==1:
        ODD=1
        
if ODD>=1:
    print("first")
else:
    print("second")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n = int(input())
d = []
for i in range(n):
    d.append(input())
# [d1, d2, d3, ..., dN]
d = [int(m) for m in d]#int型に直す
cnt = 0
for i in range(n):
    if d[i] % 2 == 0:
        cnt += 1
if cnt == n:
    print("second")
else:
    print("first")

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
z=[0 for i in range(N)]
for i in range(N):
	z[i]=int(input())
flag = "second"
for zz in z:
	if zz % 2 == 1:
		flag = "first"
		break
print(flag)

Submission status: Accepted

Solution code:
#!/mnt/c/Users/moiki/bash/env/bin/python
N = int(input())
a = []
ok = False
for i in range(N):
    inp = int(input())
    a.append(inp)
    if inp % 2 != 0:
        ok = True
if ok:
    print("first")
else:
    print("second")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
a = [int(input()) for _ in range(N)]
a.sort()

ans = 0
s = 0
for i, x in enumerate(a):
    x -= s
    if x == 0:
        continue
    ans ^= (x % 2) * (N - i)
    s += x

print(['second', 'first'][ans != 0])

Submission status: Accepted

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

flag = 0
for i in range(N):
  a = int(input())
  if a % 2 == 1:
    flag=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(raw_input())
A = []

for i in range(N):
    a = int(raw_input())
    if a % 2 == 1:
        A.append(True)
    else:
        A.append(False)

if any(A):
    print('first')
else:
    print('second')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = [int(input()) for _ in range(N)]
if all(list(map(x%2==0, a))):
  print("second")
else:
  print("first")

Submission status: Runtime Error

Solution code:
n=int(input())
flag=true
for _ in range(n):
  k=int(input())
  if k%2==1:
    flag=false
if flag:
  print("first")
else:
  print("second")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(raw_input())

answer = "first"
for i in xrange(n):
  a = int(raw_input())
  if not a % 2 == 0:
    answer = "second"
    
print answer

Submission status: Runtime Error

Solution code:
n = int(input())

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

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

elif 
    print('second')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
N,M = map(int,input().split())
Max = 1
for m in range(1,int(math.sqrt(M))+1):
    if M%m == 0:
        if m == int(m**(1/N))**N   :
            if Max < int(m**(1/N)):
                Max = int(m**(1/N))
        if M//m == int((M//m)**(1/N))**N and int((M//m)**(1/N)) <= M**(1/N) and Max < int((M//m)**(1/N)) :
            Max = int((M//m)**(1/N))
            
print(Max)

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
flag=True
for i in a:
    if a%2==1:
        flag=False

if a.count(1)==len(a):
    print("first")
elif flag:
else:
    print("second")

Submission status: Runtime Error

Solution code:
n = int(input())
num_list = {}
for i in range(n):
    a = int(input())
    num_list.append(a)
if max(num_list) == even:
    print('first')
else:
    print('second')

Submission status: Runtime Error

Solution code:
n=int(input())
ma=int(input())
l=[]
l.appned(ma)
for i in range(n-1):
  l.append(int(input()))
ma=max(l)
mi=min(l)
f=l.count(ma)%2
if (ma-mi)%2:
  if f==0:
    print('second')
  else:
    print('first')
else:
    print('second')

Submission status: Runtime Error

Solution code:
for i in range(10000000000000000000000000000000000):
input()

Submission status: Runtime Error

Solution code:
n=int(input())
ma=int(input())
l=[]
for i in range(n):
  l.append(int(input()))
ma=max(l)
mi=min(l)
f=l.count(ma)%2
if (ma-mi)%2:
  if f==0:
    print('second')
  else:
    print('first')
else:
    print('second')

Submission status: Runtime Error

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

# tree = [3,1,1,1]
# apple = sum(tree)
# N = len(tree)


if N == 1:
    if apple %2 == 0:
        print("second")
    else:
        print("first")
else:
    tree2 = tree.copy()
    tree2.remove(max(tree))

if set(tree) == {1}:
    print("first")
elif set(tree2) == {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: Runtime Error

Solution code:
n=int(input())
ma=int(input())
l=[]
for i in range(n-1):
  l.append(int(input()))
ma=max(l)
mi=min(l)
f=l.count(ma)%2
if (ma-mi)%2:
  if f==0:
    print('second')
  else:
    print('first')
else:
  if f==0:
    print('first')
  else:
    print('second')

Submission status: Runtime Error

Solution code:
import heapq
N=int(input())
box=[]
for i in range(N):
    box.append(int(input()))

ast=heapq.nlargest(2,box)

ans='first' if (ast[0]-ast[1])%2!=0 else 'second'

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
A=[0 for i in range(n)]
for i in range(n):
	A[i]=int(input())
A.sort()
for  i in range(len(A)):
	A[i]%=2
if sum(A[:-3:])%2==0:

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

if sum(A[:-3:])%2==1:

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

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]
for i in range(n):
    a[i]=int(input())
if a.count(1)==len(a):
    print("first")
else:
    print("second")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

# tree = [3,1,1,1]
# apple = sum(tree)
# N = len(tree)

tree2 = tree.copy()
tree2.remove(max(tree))

if set(tree) == {1}:
    print("first")
elif max(tree2) == 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: Runtime Error

Solution code:
n = int(input())
list = [int(input()) for i in range(n)]
list.sort(reverse=True)
if (list[0] - list[1]) %2 == 0:
    print('second')
else:
    print('first')

Submission status: Runtime Error

Solution code:
N = int(input())

for i in range(0, N):
    if int(input())% 2 == 0:
        cnt = cnt + 1
if cnt % 2 == 0:
    print('first')
else:
    print('second')

Submission status: Runtime Error

Solution code:
N = int(input())

Alist = []
for i in range(0, N):
    Alist.append(int(input()))

for j in range(0, len(Alist)):
    if Alist[j] % 2 == 0:
        cnt = cnt + 1
if cnt % 2 == 0:
    print('second')
else:
    print('first')

Submission status: Runtime Error

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

Submission status: Runtime Error

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:
        ffag = 0
        for i in range(N):
            if a[i] == 1:
                flag = 1
        if flag == 1:
            print("first")
        else:
            print("second")
    else:
        print("first")

Submission status: Runtime Error

Solution code:
import collections
from functools import reduce

n = int(input())

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

kai = 0


def gcd(a, b):
    while b:
        a, b = b, a % b

    return a


mi = reduce(gcd, a)
a = list(map(lambda x: x // mi, a))


def eat(l):
    li = reduce(gcd, l)
    l = list(map(lambda x: x//li, l))


    for i in range(len(l)):
        if l[i] % 2 == 1:
            l[i] -= 1

#    print(l)

    return l



while True:
    kai += 1

    if a.count(0) == n-1:
        nokori = collections.Counter(a).most_common()[1][0]
#        print(nokori)
        kai += (nokori - 1)
#        print(kai)

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

        exit(0)


    a = eat(a)

Submission status: Runtime Error

Solution code:
n=input()
p=1
for i in range(n):
    a=input()
    if a%2:
        p=0
print(['first','second'][p])

Submission status: Runtime Error

Solution code:
import fraction
from functools import reduce

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

def gcd(*numbers):
    return reduce(fraction.gcd, numbers)

def gcd_list(numbers):
    return reduce(fraction.gcd, numbers)

res = gcd(*a)
if res % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

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

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

res = gcd(*a)
if res % 2 == 0:
    print("second")
else:
    print("first")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# encoding: utf-8
import math
N, P = map(int, input().split())

ans = 1
P_tmp = P
for p in range(2, int(math.sqrt(P)) + 1):
    if P_tmp % (p ** N) == 0:
        for i_p in range(1, P):
            if P_tmp % (p ** (N * (i_p + 1))) > 0: break
        P_tmp = P_tmp // (p ** (N * i_p))
        ans = ans * (p ** i_p)
    if P_tmp < ((p + 1) ** N): break

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from functools import reduce

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = []

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

a.sort()
c = a[-1] - a[-2]

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = []

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

a.sort()
c = a[-1] - a[-2]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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