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

Solution (Python):
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')

Solution (Python):


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

Solution (Python):
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")

Solution (Python):
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))

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

Solution (Python):
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")

Solution (Python):
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")

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

d = [int(m) for m in d]
cnt = 0
for i in range(n):
    if d[i] % 2 == 0:
        cnt += 1
if cnt == n:
    print("second")
else:
    print("first")

Solution (Python):
N=int(input())

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

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

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

Solution (Python):
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)

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

Solution (Python):

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

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

print(res)

Solution (Python):
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")

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

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

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

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

Solution (Python):
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")

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

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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")