Vasya has become interested in wrestling. In wrestling wrestlers use techniques for which they are awarded points by judges. The wrestler who gets the most points wins.

When the numbers of points of both wrestlers are equal, the wrestler whose sequence of points is lexicographically greater, wins.

If the sequences of the awarded points coincide, the wrestler who performed the last technique wins. Your task is to determine which wrestler won.


-----Input-----

The first line contains number n — the number of techniques that the wrestlers have used (1 ≤ n ≤ 2·10^5). 

The following n lines contain integer numbers a_{i} (|a_{i}| ≤ 10^9, a_{i} ≠ 0). If a_{i} is positive, that means that the first wrestler performed the technique that was awarded with a_{i} points. And if a_{i} is negative, that means that the second wrestler performed the technique that was awarded with ( - a_{i}) points.

The techniques are given in chronological order.


-----Output-----

If the first wrestler wins, print string "first", otherwise print "second"


-----Examples-----
Input
5
1
2
-3
-4
3

Output
second

Input
3
-1
-2
3

Output
first

Input
2
4
-4

Output
second



-----Note-----

Sequence x  =  x_1x_2... x_{|}x| is lexicographically larger than sequence y  =  y_1y_2... y_{|}y|, if either |x|  >  |y| and x_1  =  y_1,  x_2  =  y_2, ... ,  x_{|}y|  =  y_{|}y|, or there is such number r (r  <  |x|, r  <  |y|), that x_1  =  y_1,  x_2  =  y_2,  ... ,  x_{r}  =  y_{r} and x_{r}  +  1  >  y_{r}  +  1.

We use notation |a| to denote length of sequence a.

Difficulty: MEDIUM

Solutions:
n = int(input())
(a, b) = ([], [])
for i in range(n):
	x = int(input())
	if x > 0:
		a.append(x)
	else:
		b.append(-x)
sum1 = sum(a)
sum2 = sum(b)
if sum1 < sum2:
	print('second')
elif sum1 > sum2:
	print('first')
elif a < b:
	print('second')
elif b < a:
	print('first')
elif x > 0:
	print('first')
else:
	print('second')


def main(n, a):
	x = [i for i in a if i >= 0]
	y = [-i for i in a if i < 0]
	if sum(x) != sum(y):
		winner = sum(y) > sum(x)
	else:
		winner = [j > i for (i, j) in zip(x, y) if j != i]
		if winner != []:
			winner = winner[0]
		else:
			winner = a[-1] < 0
	print(['first', 'second'][winner])

def main_input():
	n = int(input())
	a = [int(input()) for i in range(n)]
	main(n, a)
main_input()


n = int(input())
a = []
b = []
for i in range(n):
	m = int(input())
	if m > 0:
		a.append(m)
	else:
		b.append(-m)
	last = m
sa = sum(a)
sb = sum(b)
if sa != sb:
	win = 1 if sa > sb else 2
elif a != b:
	win = 1 if a > b else 2
else:
	win = 1 if last > 0 else 2
print('first' if win == 1 else 'second')


n = int(input())
a = []
b = []
check = 0
for i in range(n):
	k = int(input())
	if k > 0:
		check = 1
		a.append(k)
		continue
	check = 0
	b.append(abs(k))
arr = sum(a)
brr = sum(b)
flag = 1
if arr > brr:
	print('first')
elif brr > arr:
	print('second')
else:
	for i in range(min(len(a), len(b))):
		if a[i] > b[i]:
			print('first')
			flag = 0
			break
		elif b[i] > a[i]:
			print('second')
			flag = 0
			break
	if flag:
		if len(a) > len(b):
			print('first')
		elif len(b) > len(a):
			print('second')
		elif check:
			print('first')
		else:
			print('second')


a = int(input())
C = []
D = []
c = 0
d = 0
for i in range(a):
	b = int(input())
	if b > 0:
		c += b
		C += [b]
	if b < 0:
		d += -b
		D += [-b]
if c > d:
	print('first')
elif c < d:
	print('second')
elif c == d:
	if C > D:
		print('first')
	if C < D:
		print('second')
	if C == D:
		if b > 0:
			print('first')
		else:
			print('second')


import sys

def input():
	return sys.stdin.readline().strip()
n = int(input())
first = []
second = []
last = -1
for i in range(n):
	x = int(input())
	if x > 0:
		first.append(x)
		last = 0
	else:
		second.append(-x)
		last = 1
first_sum = sum(first)
second_sum = sum(second)
if first_sum > second_sum:
	print('first')
elif first_sum < second_sum:
	print('second')
else:
	winner = 'none'
	for i in range(min(len(first), len(second))):
		if first[i] > second[i]:
			winner = 'first'
			break
		elif first[i] < second[i]:
			winner = 'second'
			break
	if winner != 'none':
		print(winner)
	else:
		winner = ['first', 'second']
		print(winner[last])


t = int(input())
l = []
first = []
second = []
for i in range(0, t):
	n = int(input())
	if n < 0:
		second.append(-1 * n)
		last = 'second'
	else:
		first.append(n)
		last = 'first'
if sum(first) > sum(second):
	print('first')
elif sum(first) == sum(second):
	if first > second:
		print('first')
	elif first == second:
		print(last)
	else:
		print('second')
else:
	print('second')


n = int(input())
s1 = []
s2 = []
(sum1, sum2) = (0, 0)
for _ in range(n):
	num = input()
	n1 = int(num)
	if n1 < 0:
		sum2 += -n1
		s2.append(-n1)
	else:
		sum1 += n1
		s1.append(n1)
if sum1 > sum2:
	print('first')
elif sum2 > sum1:
	print('second')
elif s1 == s2:
	if n1 > 0:
		print('first')
	else:
		print('second')
else:
	for i in range(n):
		if s1[i] != s2[i]:
			if s1[i] > s2[i]:
				print('first')
			else:
				print('second')
			break


n = int(input())
first = []
second = []
lastone = 0
c = 0
for i in range(n):
	a = int(input())
	if a > 0:
		first.append(a)
	else:
		second.append(abs(a))
	if i == n - 1:
		lastone = a
sum_f = sum(first)
sum_s = sum(second)
len_f = len(first)
len_s = len(second)
if sum_f > sum_s:
	print('first')
elif sum_s > sum_f:
	print('second')
else:
	len_m = min(len_f, len_s)
	for i in range(len_m):
		if first[i] > second[i]:
			print('first')
			c = 1
			break
		elif second[i] > first[i]:
			print('second')
			c = 1
			break
	if c == 0:
		if len_f > len_s:
			print('first')
		elif len_s > len_f:
			print('second')
		elif lastone > 0:
			print('first')
		else:
			print('second')


n = int(input())
a = []
b = []
last = ''
for i in range(n):
	x = int(input())
	if x > 0:
		a.append(x)
		last = 'first'
	elif x < 0:
		b.append(abs(x))
		last = 'second'
if sum(a) > sum(b):
	print('first')
elif sum(b) > sum(a):
	print('second')
elif a > b:
	print('first')
elif b > a:
	print('second')
else:
	print(last)


X = int(input())
E = []
F = []
S = []
for I in range(X):
	t = int(input())
	if t > 0:
		F.append(t)
	else:
		S.append(-t)
	E.append(t)
if sum(F) > sum(S):
	print('first')
elif sum(F) < sum(S):
	print('second')
else:
	a = [int(x) for x in F]
	b = [int(x) for x in S]
	if a > b:
		print('first')
	elif a < b:
		print('second')
	elif E[-1] > 0:
		print('first')
	else:
		print('second')


import sys

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

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
n = iinput()
f = []
s = []
sumf = sums = 0
for _ in range(n):
	a = iinput()
	if a > 0:
		f.append(a)
		sumf += a
	else:
		s.append(-1 * a)
		sums += abs(a)
	last = a
if sumf > sums:
	print('first')
elif sums > sumf:
	print('second')
elif f > s:
	print('first')
elif s > f:
	print('second')
elif last == abs(last):
	print('first')
else:
	print('second')


n = int(input())
w1 = 0
w2 = 0
l1 = []
l2 = []
last = 0
for i in range(0, n):
	j = int(input())
	if j > 0:
		w1 += j
		last = 1
		l1.append(j)
	else:
		w2 += -j
		last = 2
		l2.append(-j)
if w1 != w2:
	print('first' if w1 > w2 else 'second')
elif l1 != l2:
	print('first' if l1 > l2 else 'second')
else:
	print('first' if last == 1 else 'second')


n = int(input())
s0 = s1 = 0
(a0, a1) = ([], [])
l0 = l1 = -1
for i in range(n):
	a = int(input())
	if a > 0:
		s0 += a
		a0 += [a]
		l0 = i
	else:
		s1 += -a
		a1 += [-a]
		l1 = i
print('first' if (s0, a0, l0) > (s1, a1, l1) else 'second')


n = int(input())
l1 = []
l2 = []
(c1, c2) = (0, 0)
for i in range(n - 1):
	a = int(input())
	if a > 0:
		l1.append(a)
		c1 += 1
	else:
		l2.append(abs(a))
		c2 += 1
last = int(input())
if last > 0:
	l1.append(last)
	j = 'first'
	c1 += 1
else:
	l2.append(abs(last))
	j = 'second'
	c2 += 1
c3 = 0
s1 = sum(l1)
s2 = sum(l2)
if s1 > s2:
	print('first')
elif s1 < s2:
	print('second')
else:
	k = min(c1, c2)
	for i in range(k):
		if l1[i] < l2[i]:
			c3 = 2
			break
		elif l1[i] > l2[i]:
			c3 = 1
			break
	if c3 == 0:
		if c2 > c1:
			c3 = 2
		elif c1 > c2:
			c3 = 1
	if c3 == 0:
		print(j)
	elif c3 == 1:
		print('first')
	else:
		print('second')


n = int(input())
(first, second) = ([], [])
(r, fs, ss) = (0, 0, 0)
flag = 0
for i in range(n):
	k = int(input())
	last = k
	if k > 0:
		first.append(k)
		fs += k
	else:
		second.append(abs(k))
		ss += abs(k)
if fs > ss:
	print('first')
	exit()
elif ss > fs:
	print('second')
	exit()
if len(first) > len(second):
	k = len(second)
	flag = 1
elif len(second) > len(first):
	k = len(first)
	flag = 2
else:
	k = len(first)
for i in range(k):
	if first[i] == second[i]:
		r += 1
	else:
		break
if r == k and flag == 0:
	if last > 0:
		print('first')
	else:
		print('second')
elif r == k and flag == 1:
	print('first')
elif r == k and flag == 2:
	print('second')
elif r < k:
	if first[r] > second[r]:
		print('first')
	else:
		print('second')


n = int(input())
n1 = -1
n2 = -1
s = 0
lex_g = 0
a = []
b = []
for i in range(n):
	k = int(input())
	if k > 0:
		n1 += 1
		a.append(k)
	else:
		n2 += 1
		b.append(abs(k))
	if n1 != -1 and n2 != -1 and (lex_g == 0):
		t = min(n1, n2)
		if a[t] > b[t]:
			lex_g = 1
		elif a[t] < b[t]:
			lex_g = 2
	s += k
if s > 0:
	print('first')
elif s < 0:
	print('second')
elif n1 == n2 and lex_g == 0:
	if k > 0:
		print('first')
	else:
		print('second')
elif n1 > n2 and lex_g == 0:
	print('first')
elif n2 > n1 and lex_g == 0:
	print('second')
elif lex_g == 1:
	print('first')
else:
	print('second')


a = []
b = []
s1 = 0
s2 = 0
n1 = int(input())
t1 = 0
for i in range(n1):
	n = int(input())
	if n < 0:
		b.append(-1 * n)
		s2 += -1 * n
	else:
		a.append(n)
		s1 += n
	if i == n1 - 1:
		if n < 0:
			t1 = 2
		else:
			t1 = 1
if s1 > s2:
	print('first')
elif s2 > s1:
	print('second')
else:
	p = 0
	for i in range(min(len(a), len(b))):
		if a[i] < b[i]:
			p = 1
			break
		elif a[i] > b[i]:
			p = 2
			break
	if p == 0:
		if t1 == 1:
			p = 2
		else:
			p = 1
	if p == 1:
		print('second')
	else:
		print('first')


n = int(input())
count1 = 0
count2 = 0
l = []
l1 = []
l2 = []
yo1 = 0
yo2 = 0
for i in range(n):
	z = int(input())
	if z > 0:
		count1 += z
		yo1 += 1
		l1.append(z)
	else:
		count2 += abs(z)
		yo2 += 1
		l2.append(-z)
	l.append(z)
if count1 > count2:
	print('first')
if count1 < count2:
	print('second')
if count1 == count2:
	if l1 != l2:
		if l2 > l1:
			print('second')
		else:
			print('first')
	elif l[-1] > 0:
		print('first')
	else:
		print('second')


import sys

def lex_cmp(seq1, seq2):
	for (p1, p2) in zip(seq1, seq2):
		if p1 > p2:
			return 1
		elif p1 < p2:
			return -1
	if p1 is None:
		return -1
	elif p2 is None:
		return 1
	else:
		return 0

def main():
	test = sys.stdin.readlines()
	n = int(test[0])
	p1 = p2 = 0
	(seq1, seq2) = ([], [])
	for i in range(n):
		points = test[i + 1]
		p = int(points)
		if p > 0:
			p1 += p
			seq1.append(p)
		else:
			p2 -= p
			seq2.append(-p)
	if p1 > p2:
		print('first')
	elif p1 < p2:
		print('second')
	elif lex_cmp(seq1, seq2) == 1:
		print('first')
	elif lex_cmp(seq1, seq2) == -1:
		print('second')
	else:
		print('second' if p < 0 else 'first')
main()


n = eval(input())
player_1 = 0
player_2 = 0
array_1 = []
array_2 = []
last_turn = 0
for i in range(n):
	a = eval(input())
	if a > 0:
		player_1 += a
		last_turn = 0
		array_1.append(a)
	else:
		player_2 += a * -1
		last_turn = 1
		array_2.append(a * -1)
if player_1 > player_2:
	output = 'first'
elif player_1 == player_2:
	if array_1 > array_2:
		output = 'first'
	elif array_1 < array_2:
		output = 'second'
	elif array_1 == array_2:
		if last_turn == 0:
			output = 'first'
		else:
			output = 'second'
else:
	output = 'second'
print(output)


from sys import stdin
stdin.readline

def mp():
	return list(map(int, stdin.readline().strip().split()))

def it():
	return int(stdin.readline().strip())
from math import pi
n = it()
(p, neg) = ([], [])
for i in range(n):
	x = it()
	if x == abs(x):
		p += [x]
	else:
		neg += [abs(x)]
flag = 0
if sum(p) > sum(neg):
	print('first')
	flag = 1
elif sum(neg) > sum(p):
	flag = 1
	print('second')
else:
	i = j = 0
	while i < len(p) and j < len(neg):
		if p[i] < abs(neg[j]):
			print('second')
			flag = 1
			break
		elif p[i] > abs(neg[j]):
			flag = 1
			print('first')
			break
		i += 1
		j += 1
if flag:
	pass
elif x > 0:
	print('first')
else:
	print('second')


n = int(input())
f = []
s = []
fsc = 0
ssc = 0
for i in range(n):
	x = int(input())
	if x > 0:
		f.append(x)
		fsc += x
	else:
		ssc += -x
		s.append(-x)
	if i == n - 1:
		las = x
if fsc > ssc:
	print('first')
elif ssc > fsc:
	print('second')
elif f > s:
	print('first')
elif f < s:
	print('second')
elif las > 0:
	print('first')
else:
	print('second')


def main():
	n = int(input())
	(p1, p2) = ([], [])
	last = 1
	for _ in range(n):
		move = int(input())
		if move > 0:
			p1.append(move)
			last = 1
		else:
			p2.append(-move)
			last = 2
	if sum(p1) != sum(p2):
		print('first' if sum(p1) > sum(p2) else 'second')
	elif p1 != p2:
		print('first' if p1 > p2 else 'second')
	else:
		print('first' if last == 1 else 'second')
main()


n = int(input())
first = []
second = []
for i in range(n):
	ai = int(input())
	if ai > 0:
		first.append(ai)
		last_first = True
	else:
		second.append(-ai)
		last_first = False
s1 = sum(first)
s2 = sum(second)
if s1 > s2:
	print('first')
elif s2 > s1:
	print('second')
elif first > second:
	print('first')
elif second > first:
	print('second')
elif last_first:
	print('first')
else:
	print('second')


n = int(input())
(first, second) = ([], [])
p = q = 0
for x in range(n):
	a = int(input())
	if abs(a) == a:
		if x == n - 1:
			last = 'first'
		first.append(a)
		p += 1
	else:
		if x == n - 1:
			last = 'second'
		second.append(abs(a))
		q += 1
(s, t) = (sum(first), sum(second))
if s > t:
	results = 'first'
elif t > s:
	results = 'second'
else:
	l = min(p, q)
	for x in range(l):
		if first[x] > second[x]:
			results = 'first'
			break
		if second[x] > first[x]:
			results = 'second'
			break
	else:
		results = last
print(results)


n = int(input())
a = []
b = []
for i in range(n):
	last = int(input())
	a.append(last) if last > 0 else b.append(-last)
sum_a = sum(a)
sum_b = sum(b)
first = True
if sum_a > sum_b:
	first = True
elif sum_b > sum_a:
	first = False
else:
	win = 0
	for i in range(min(len(a), len(b))):
		if a[i] > b[i]:
			win = 1
			break
		if b[i] > a[i]:
			win = 2
			break
	if win == 1:
		first = True
	elif win == 2:
		first = False
	elif last > 0:
		first = True
	else:
		first = False
if first:
	print('first')
else:
	print('second')


k = []
p = []
s = 0
s1 = 0
a = 0
gh = int(input())
for _ in range(1, gh + 1):
	a = int(input())
	if a > 0:
		k += [a]
		s += a
	else:
		p += [abs(a)]
		s1 += a
z = lambda x: ['first', 'second'][x]
s1 = abs(s1)
if s != s1:
	print(z(s1 > s))
else:
	if k == p:
		print(z(a < 0))
		exit()
	for (a, b) in zip(k, p):
		if a != b:
			print(z(b > a))
			exit()


from sys import stdin
n = int(stdin.readline())
(first, second, sum1, sum2, last) = ([], [], 0, 0, 0)
(app1, app2) = (first.append, second.append)
for i in range(n):
	x = int(stdin.readline())
	if x > 0:
		app1(x)
		sum1 += x
	else:
		app2(-x)
		sum2 += -x
	last = x
if sum1 > sum2:
	print('first')
elif sum1 < sum2:
	print('second')
elif first > second:
	print('first')
elif first < second:
	print('second')
elif last > 0:
	print('first')
else:
	print('second')


n = int(input())
a = []
for i in range(0, n):
	a.append(int(input()))
neg = []
pos = []
(l, s1, s2) = (0, 0, 0)
for i in range(0, n):
	if a[i] < 0:
		neg.append(-a[i])
		s2 = s2 - a[i]
		l = 0
	else:
		pos.append(a[i])
		s1 = s1 + a[i]
		l = 1
if s1 > s2:
	print('first')
elif s1 < s2:
	print('second')
elif neg > pos:
	print('second')
elif pos > neg:
	print('first')
elif l == 1:
	print('first')
else:
	print('second')


import math
from decimal import *
import random
mod = int(1000000000.0) + 7
(f, s) = (0, 0)
(x, y) = ([], [])
last = -1
for _ in range(int(input())):
	n = int(input())
	if n > 0:
		x.append(n)
		f += n
		last = 1
	else:
		y.append(abs(n))
		s += abs(n)
		last = 0
if f > s:
	print('first')
if s > f:
	print('second')
if s == f:
	if len(x) > len(y):
		fnd = True
		for i in range(len(y)):
			if x[i] != y[i]:
				fnd = False
				break
		if fnd:
			print('first')
		else:
			fwin = True
			pnt = 0
			while pnt < len(y):
				if x[pnt] > y[pnt]:
					fwin = True
					break
				elif x[pnt] == y[pnt]:
					pnt += 1
				else:
					fwin = False
					break
			if fwin and pnt != len(y):
				print('first')
			elif not fwin and pnt != len(y):
				print('second')
			elif last:
				print('first')
			else:
				print('second')
	elif len(y) > len(x):
		fnd = True
		for i in range(len(x)):
			if x[i] != y[i]:
				fnd = False
				break
		if fnd:
			print('second')
		else:
			fwin = True
			pnt = 0
			while pnt < len(y):
				if x[pnt] > y[pnt]:
					fwin = True
					break
				elif x[pnt] == y[pnt]:
					pnt += 1
				else:
					fwin = False
					break
			if fwin and pnt != len(y):
				print('first')
			elif not fwin and pnt != len(y):
				print('second')
			elif last:
				print('first')
			else:
				print('second')
	else:
		fwin = True
		pnt = 0
		while pnt < len(y):
			if x[pnt] > y[pnt]:
				fwin = True
				break
			elif x[pnt] == y[pnt]:
				pnt += 1
			else:
				fwin = False
				break
		if fwin and pnt != len(y):
			print('first')
		elif not fwin and pnt != len(y):
			print('second')
		elif last:
			print('first')
		else:
			print('second')


w1 = []
w2 = []
last = 1
for _ in range(int(input())):
	x = int(input())
	if x > 0:
		w1.append(x)
		last = 1
	else:
		w2.append(-x)
		last = 2
sw1 = sum(w1)
sw2 = sum(w2)
if sw1 > sw2 or (sw1 == sw2 and w1 > w2) or (sw1 == sw2 and w1 == w2 and (last == 1)):
	print('first')
else:
	print('second')


n = int(input())
s1 = []
s2 = []
for i in range(n):
	t = int(input())
	if t > 0:
		s1 += [t]
	else:
		s2 += [-t]
if sum(s1) == sum(s2):
	if s1 > s2:
		print('first')
	elif s2 > s1:
		print('second')
	elif t > 0:
		print('first')
	else:
		print('second')
elif sum(s1) > sum(s2):
	print('first')
else:
	print('second')


l1 = []
l2 = []
num1 = 0
num2 = 0
lst = []
n = int(input())
for i in range(n):
	s: int = int(input())
	if s > 0:
		l1.append(s)
		num1 += s
		lst.append('1')
	else:
		l2.append(abs(s))
		num2 += abs(s)
		lst.append('2')
if num1 > num2:
	print('first')
elif num1 < num2:
	print('second')
else:
	a = min(len(l1), len(l2))
	b = 0
	n1 = 0
	n2 = 0
	for i in range(a):
		n1 += l1[i]
		n2 += l2[i]
		if n1 > n2:
			b = 1
			break
		if n1 < n2:
			b = 2
			break
	if b == 1:
		print('first')
	elif b == 2:
		print('second')
	elif lst[-1] == '1':
		print('first')
	else:
		print('second')


import math
q = 1
for _ in range(q):
	n = int(input())
	first = []
	second = []
	last = 0
	for i in range(n):
		a = int(input())
		last = a
		if a > 0:
			first.append(a)
		else:
			second.append(abs(a))
	sum1 = sum(first)
	sum2 = sum(second)
	if sum1 > sum2:
		print('first')
	elif sum1 < sum2:
		print('second')
	else:
		flag = False
		for i in range(min(len(first), len(second))):
			if first[i] > second[i]:
				print('first')
				flag = False
				break
			elif first[i] < second[i]:
				flag = False
				print('second')
				break
			else:
				flag = True
				continue
		if flag:
			if last > 0:
				print('first')
			else:
				print('second')


n = int(input())
fr = []
sec = []
suf = 0
sus = 0
lal = 0
for i in range(n):
	t = int(input())
	if t < 0:
		sec.append(-t)
		sus -= t
		lal = 'second'
	else:
		fr.append(t)
		suf += t
		lal = 'first'
if suf > sus:
	print('first')
elif sus > suf:
	print('second')
elif sec > fr:
	print('second')
elif fr != sec:
	print('first')
else:
	print(lal)


n = int(input())
c1 = 0
c2 = 0
c11 = []
c22 = []
ko = 0
for i in range(n):
	a = int(input())
	if a > 0:
		c1 += a
		kk = str(a)
		c11.append(a)
		ko = 1
	else:
		c2 += abs(a)
		kk = str(abs(a))
		c22.append(abs(a))
		ko = 0
if len(c11) < len(c22):
	pp = 1
elif len(c11) > len(c22):
	pp = -1
else:
	pp = 0
for i in range(min(len(c11), len(c22))):
	if c11[i] > c22[i]:
		pp = 1
		break
	elif c11[i] < c22[i]:
		pp = -1
		break
if c1 > c2:
	print('first')
elif c1 < c2:
	print('second')
elif c1 == c2:
	if pp == 1:
		print('first')
	elif pp == -1:
		print('second')
	elif pp == 0:
		if ko == 0:
			print('second')
		elif ko == 1:
			print('first')


n = int(input())
(f, s) = ([], [])
for i in range(n):
	mark = input()
	if i == n - 1:
		last = mark
	if mark[0] == '-':
		s.append(int(mark[1:]))
	else:
		f.append(int(mark))
(s1, s2) = (sum(f), sum(s))
if s1 > s2:
	print('first')
elif s1 < s2:
	print('second')
else:
	(l1, l2) = (len(f), len(s))
	if l1 > l2 and f[:l2] == s:
		print('first')
	elif l1 < l2 and s[:l1] == f:
		print('second')
	else:
		for i in range(max(len(f), len(s))):
			if f[i] > s[i]:
				print('first')
				break
			elif f[i] < s[i]:
				print('second')
				break
		else:
			if last[0] == '-':
				print('second')
			else:
				print('first')


n = int(input())
first = []
second = []
sum = 0
for _ in range(n):
	a = int(input())
	if a > 0:
		first.append(a)
	else:
		second.append(-a)
	sum += a
if sum > 0:
	print('first')
	exit()
if sum < 0:
	print('second')
	exit()
if first > second:
	print('first')
	exit()
if second > first:
	print('second')
	exit()
if a > 0:
	print('first')
else:
	print('second')


import os
import sys
from io import BytesIO, IOBase
import math
import itertools
import bisect
import heapq

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countcon(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def lis(arr):
	n = len(arr)
	lis = [1] * n
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
	maximum = 0
	for i in range(n):
		maximum = max(maximum, lis[i])
	return maximum

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def maxfac(n):
	root = int(n ** 0.5)
	for i in range(2, root + 1):
		if n % i == 0:
			return n // i
	return n

def p2(n):
	c = 0
	while n % 2 == 0:
		n //= 2
		c += 1
	return c

def seive(n):
	primes = [True] * (n + 1)
	primes[1] = primes[0] = False
	for i in range(2, n + 1):
		if primes[i]:
			for j in range(i + i, n + 1, i):
				primes[j] = False
	p = []
	for i in range(0, n + 1):
		if primes[i]:
			p.append(i)
	return p

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def denofactinverse(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return pow(fac, m - 2, m)

def numofact(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return fac

def lex(a, b):
	for i in range(0, min(len(a), len(b))):
		if a[i] > b[i]:
			return 1
		elif a[i] < b[i]:
			return -1
	if len(a) == len(b):
		return 0
	elif len(a) > len(b):
		return -1
	else:
		return 1
l = []
for i in range(0, int(input())):
	l.append(int(input()))
(f, s) = ([], [])
for i in l:
	if i > 0:
		f.append(i)
	else:
		s.append(-i)
if sum(f) == sum(s):
	num = lex(f, s)
	if num == 1:
		print('first')
	elif num == -1:
		print('second')
	else:
		print('first' if l[-1] > 0 else 'second')
elif sum(f) > sum(s):
	print('first')
else:
	print('second')


class CodeforcesTask493BSolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.points = []

	def read_input(self):
		self.n = int(input())
		for x in range(self.n):
			self.points.append(int(input()))

	def process_task(self):
		first = [x for x in self.points if x > 0]
		second = [-x for x in self.points if x < 0]
		f_points = sum(first)
		s_points = sum(second)
		if f_points > s_points:
			self.result = 'first'
		elif f_points < s_points:
			self.result = 'second'
		elif len(first) > len(second) and first[:len(second)] == second:
			self.result = 'first'
		elif len(first) < len(second) and first == second[:len(first)]:
			self.result = 'second'
		else:
			x = 0
			while first[x] == second[x]:
				x += 1
				if x == len(first):
					break
			if x == len(first):
				if self.points[-1] > 0:
					self.result = 'first'
				else:
					self.result = 'second'
			elif first[x] > second[x]:
				self.result = 'first'
			else:
				self.result = 'second'

	def get_result(self):
		return self.result
Solution = CodeforcesTask493BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
f = []
s = []
first = 0
second = 0
save = -1
sum = 0
for i in range(n):
	a = int(input())
	if a < 0:
		second -= a
		s += [-a]
	else:
		first += a
		f += [a]
	sum += a
	if i == n - 1:
		save = a
if sum != 0:
	if sum > 0:
		print('first')
	else:
		print('second')
else:
	c = 0
	if len(f) < len(s):
		for i in range(len(f)):
			if s[i] > f[i]:
				c = 1
				break
			if s[i] < f[i]:
				c = 2
				print('first')
				break
		if c == 1 or c == 0:
			c = 1
			print('second')
	elif len(f) > len(s):
		for i in range(len(s)):
			if f[i] > s[i]:
				c = 1
				break
			if f[i] < s[i]:
				print('second')
				c = 2
				break
		if c == 1 or c == 0:
			c = 1
			print('first')
	elif len(f) == len(s):
		for i in range(len(s)):
			if f[i] > s[i]:
				print('first')
				c = 1
				break
			if s[i] > f[i]:
				print('second')
				c = 1
				break
	if c == 0:
		if save < 0:
			print('second')
		else:
			print('first')


import sys
numcases = int(sys.stdin.readline())
ht = [0]
at = [0]
x = 2
for casenum in range(1, numcases + 1):
	a = int(sys.stdin.readline())
	if a > 0:
		ht += [a]
		x = 0
	else:
		at += [a * -1]
		x = 1
if sum(ht) != sum(at):
	if sum(ht) > sum(at):
		print('first')
	if sum(ht) < sum(at):
		print('second')
elif ht == at:
	if x == 0:
		print('first')
	else:
		print('second')
elif ht > at:
	print('first')
else:
	print('second')


__author__ = 'PrimuS'
n = int(input())
p1 = [0] * n
p2 = [0] * n
n1 = 0
n2 = 0
last = -1
for i in range(n):
	a = int(input())
	if a > 0:
		p1[n1] = a
		n1 += 1
		last = 1
	else:
		p2[n2] = -a
		n2 += 1
		last = 2
s1 = sum(p1)
s2 = sum(p2)
if s1 > s2:
	print('first')
elif s2 > s1:
	print('second')
else:
	res = 0
	i = 0
	while i < len(p1) and i < len(p2):
		if p1[i] > p2[i]:
			res = 1
		elif p2[i] > p1[i]:
			res = 2
		i += 1
		if res != 0:
			break
	if res > 0 or (res == 0 and len(p1) != len(p2)):
		if res == 1 or (res == 0 and len(p1) > len(p2)):
			print('first')
		else:
			print('second')
	elif last == 1:
		print('first')
	else:
		print('second')


n = int(input())
l1 = []
l2 = []
last = 0
s1 = 0
s2 = 0
n1 = 0
n2 = 0
for i in range(n):
	x = int(input())
	if x > 0:
		l1.append(x)
		s1 += x
		n1 += 1
	else:
		l2.append(-x)
		s2 += -x
		n2 += 1
if x > 0:
	last = 1
else:
	last = 2
if s1 > s2:
	print('first')
elif s2 > s1:
	print('second')
elif l1 == l2:
	if last == 1:
		print('first')
	else:
		print('second')
else:
	for i in range(min(n1, n2)):
		if l1[i] > l2[i]:
			print('first')
			break
		elif l2[i] > l1[i]:
			print('second')
			break
		else:
			pass


plus = 0
minus = 0
ps = []
ms = []
arr = []
for _ in range(int(input())):
	x = int(input())
	if x > 0:
		plus += x
		ps.append(x)
	else:
		minus += abs(x)
		ms.append(abs(x))
	arr.append(x)
if plus > minus:
	print('first')
elif minus > plus:
	print('second')
else:
	p = 0
	pl = len(ps)
	ml = len(ms)
	for i in range(min(pl, ml)):
		if ps[i] > ms[i]:
			print('first')
			p = 1
			break
		elif ps[i] < ms[i]:
			print('second')
			p = 1
			break
	if not p:
		if pl > ml:
			print('second')
		elif ml < pl:
			print('first')
		else:
			print('first' if arr[-1] > 0 else 'second')


from functools import reduce
from operator import *
from math import *
from sys import *
setrecursionlimit(10 ** 7)
RI = lambda : list(map(int, input().split()))
RS = lambda : input().rstrip().split()
n = RI()[0]
last = 0
fi = []
se = []
for i in range(n):
	a = RI()[0]
	if a > 0:
		last = 1
		fi.append(a)
	else:
		last = 2
		se.append(-a)
(suma, sumb) = (sum(fi), sum(se))
if suma > sumb:
	print('first')
elif suma < sumb:
	print('second')
elif fi > se:
	print('first')
elif fi < se:
	print('second')
elif last == 1:
	print('first')
else:
	print('second')


def main():
	from sys import stdin, stdout
	(n, p) = ([], [])
	for _ in range(int(stdin.readline())):
		last = int(stdin.readline())
		if last < 0:
			n.append(-1 * last)
		else:
			p.append(last)
	if sum(p) > sum(n):
		stdout.write('first')
	elif sum(n) > sum(p):
		stdout.write('second')
	else:
		maxim = max(n, p)
		if maxim == p:
			if maxim == n:
				if last < 0:
					stdout.write('second')
				else:
					stdout.write('first')
			else:
				stdout.write('first')
		else:
			stdout.write('second')
main()


n = int(input())
first = []
second = []
last = ''
for j in range(n):
	x = int(input())
	if j == n - 1:
		if x > 0:
			last = 'first'
		else:
			last = 'second'
	if x > 0:
		first.append(x)
	else:
		second.append(abs(x))
if sum(first) > sum(second):
	print('first')
elif sum(second) > sum(first):
	print('second')
else:
	for i in range(min(len(first), len(second))):
		if first[i] > second[i]:
			print('first')
			exit()
		elif second[i] > first[i]:
			print('second')
			exit()
	if len(first) > len(second):
		print('first')
	elif len(second) > len(first):
		print('second')
	else:
		print(last)


n = int(input())
(a, b) = ([], [])
t = [int(input()) for j in range(n)]
for i in t:
	if i > 0:
		a.append(i)
	else:
		b.append(-i)
(u, v) = (sum(a), sum(b))
if u == v:
	u += t[-1] if a == b else 2 * (a > b) - 1
print(['first', 'second'][u < v])


n = int(input())
a = []
b = []
first = True
i = 0
j = 0
for i in range(n):
	d = int(input())
	if d > 0:
		a.append(d)
		last = 0
	else:
		b.append(-d)
		last = 1
suma = sum(a)
sumb = sum(b)
if suma > sumb:
	print('first')
elif sumb > suma:
	print('second')
else:
	done = False
	lena = len(a)
	lenb = len(b)
	for i in range(min(lena, lenb)):
		if a[i] > b[i]:
			print('first')
			done = True
			break
		elif a[i] < b[i]:
			print('second')
			done = True
			break
	if not done:
		if lena > lenb:
			print('first')
		elif lenb > lena:
			print('second')
		elif last == 0:
			print('first')
		else:
			print('second')


list1 = []
list2 = []
x = int(input())
for _ in range(x - 1):
	n = int(input())
	if n > 0:
		list1.append(n)
	else:
		list2.append(abs(n))
n = int(input())
if n > 0:
	list1.append(n)
	list3 = ['first']
else:
	list2.append(abs(n))
	list3 = ['second']
s1 = sum(list1)
s2 = sum(list2)
if s1 > s2:
	print('first')
elif s2 > s1:
	print('second')
else:
	if len(list1) > len(list2):
		list2 = list2 + [0] * (len(list1) - len(list2))
	elif len(list2) > len(list1):
		list1 = list1 + [0] * (len(list2) - len(list1))
	x = len(list1)
	f = 0
	for i in range(x):
		x = list1[i] - list2[i]
		if x > 0:
			print('first')
			f = 1
			break
		elif x < 0:
			print('second')
			f = 1
			break
	if f == 0:
		print(*list3)


n = int(input())
l1 = []
l2 = []
s1 = 0
s2 = 0
for i in range(n):
	a = int(input())
	if a > 0:
		l1.append(a)
		s1 += a
	else:
		l2.append(abs(a))
		s2 += abs(a)
if s1 > s2:
	print('first')
elif s2 > s1:
	print('second')
else:
	leng1 = len(l1)
	leng2 = len(l2)
	leng = min(leng1, leng2)
	k = -1
	if leng1 > leng2:
		k = 1
	elif leng1 < leng2:
		k = 2
	for i in range(leng):
		if l1[i] > l2[i]:
			k = 1
			break
		elif l1[i] < l2[i]:
			k = 2
			break
	if k == -1:
		if a > 0:
			print('first')
		else:
			print('second')
	elif k == 1:
		print('first')
	else:
		print('second')


n = int(input())
w1 = []
w2 = []
flag = 0
for i in range(n):
	inp = int(input())
	if i == n - 1:
		if inp > 0:
			flag = 1
	ninp = inp * -1
	if inp > 0:
		w1.append(inp)
	else:
		w2.append(ninp)
if sum(w1) > sum(w2):
	print('first')
elif sum(w1) < sum(w2):
	print('second')
elif w1 > w2:
	print('first')
elif w2 > w1:
	print('second')
elif flag == 1:
	print('first')
else:
	print('second')


n = int(input())
first = []
second = []
for i in range(n):
	a = int(input())
	b = a
	if a > 0:
		first.append(a)
	else:
		second.append(a)
if sum(first) > abs(sum(second)):
	print('first')
	quit()
elif sum(first) < abs(sum(second)):
	print('second')
	quit()
else:
	if first != second:
		for j in range(min(len(first), len(second))):
			if first[j] == abs(second[j]):
				continue
			elif first[j] > abs(second[j]):
				print('first')
				quit()
			else:
				print('second')
				quit()
	if b > 0:
		print('first')
	else:
		print('second')


n = int(input())
last = ''
first = []
second = []
for i in range(0, n):
	num = int(input())
	if num > 0:
		first.append(num)
		last = 'first'
	else:
		second.append(abs(num))
		last = 'second'
if sum(first) > sum(second):
	print('first')
elif sum(first) < sum(second):
	print('second')
elif sum(first) == sum(second):
	if first > second:
		print('first')
	elif second > first:
		print('second')
	else:
		print(last)


n = int(input())
(s1, s2) = ([], [])
(sum1, sum2) = (0, 0)
for i in range(n):
	m = input().split()[0]
	if m[0] == '-':
		s2 += [int(m[1:])]
		sum2 += int(m[1:])
	else:
		s1 += [int(m)]
		sum1 += int(m)
if sum1 > sum2:
	print('first')
elif sum2 > sum1:
	print('second')
elif s1 == s2:
	if int(m) < 0:
		print('second')
	else:
		print('first')
elif s1 > s2:
	print('first')
else:
	print('second')


def zip_sorted(a, b):
	(a, b) = zip(*sorted(zip(a, b)))
	sorted(zip(a, b), key=lambda x: x[1])
	return (a, b)
n = int(input())
first = []
second = []
p1 = 0
p2 = 0
last = ''
for t1 in range(n):
	n1 = int(input())
	if n1 < 0:
		second.append(str(-1 * n1))
		p2 = p2 + -1 * n1
		if t1 == n - 1:
			last = 'second'
	else:
		first.append(str(n1))
		p1 = p1 + n1
		if t1 == n - 1:
			last = 'first'
if p1 > p2:
	print('first')
elif p2 > p1:
	print('second')
else:
	ans = ''
	count = 0
	if len(first) < len(second):
		for i in range(min(len(first), len(second))):
			if int(first[i]) > int(second[i]):
				ans = 'first'
				count = 1
				break
			elif int(first[i]) < int(second[i]):
				ans = 'second'
				count = 1
				break
			else:
				pass
		if count == 1:
			print(ans)
		else:
			print('second')
	elif len(first) > len(second):
		for i in range(min(len(first), len(second))):
			if int(first[i]) > int(second[i]):
				ans = 'first'
				count = 1
				break
			elif int(first[i]) < int(second[i]):
				ans = 'second'
				count = 1
				break
			else:
				pass
		if count == 1:
			print(ans)
		else:
			print('first')
	else:
		for i in range(min(len(first), len(second))):
			if int(first[i]) > int(second[i]):
				ans = 'first'
				count = 1
				break
			elif int(first[i]) < int(second[i]):
				ans = 'second'
				count = 1
				break
			else:
				pass
		if count == 1:
			print(ans)
		else:
			print(last)


n = int(input())
pts = 0
fL = []
sL = []
for i in range(n):
	x = int(input())
	pts += x
	if x > 0:
		fL.append(x)
	else:
		sL.append(-x)
if pts > 0:
	print('first')
elif pts < 0:
	print('second')
elif fL > sL:
	print('first')
elif fL < sL:
	print('second')
else:
	print('first' if x > 0 else 'second')


n = int(input())
f = []
s = []
for _ in range(n):
	a = int(input())
	if a < 0:
		s.append(abs(a))
		last = 'second'
	else:
		f.append(a)
		last = 'first'
if sum(f) > sum(s):
	print('first')
elif sum(s) > sum(f):
	print('second')
else:
	temp = 0
	for i in range(min(len(f), len(s))):
		if f[i] < s[i]:
			temp = 'second'
			break
		elif f[i] > s[i]:
			temp = 'first'
			break
	if temp == 0:
		if len(f) < len(s):
			print('second')
		elif len(f) > len(s):
			print('first')
		else:
			print(last)
	else:
		print(temp)


n = int(input())
a = []
b = []
s1 = 0
s2 = 0
last = 0
for i in range(1, n + 1):
	x = int(input())
	if x >= 0:
		s1 += x
		a.append(x)
	else:
		s2 += -1 * x
		b.append(-1 * x)
	last = x
if s1 > s2:
	print('first')
elif s2 > s1:
	print('second')
elif s1 == s2:
	flag = False
	for i in range(min(len(a), len(b))):
		if a[i] != b[i]:
			if a[i] > b[i]:
				print('first')
			else:
				print('second')
			flag = True
			break
	if flag == False:
		if x > 0:
			print('first')
		else:
			print('second')


while True:
	try:

		def winner(f, s, a):
			first = False
			second = False
			i = j = 0
			mln = min(len(f), len(s))
			while i < mln:
				if f[i] == s[i]:
					i += 1
					continue
				elif f[i] > s[i]:
					first = True
					break
				else:
					second = True
					break
				i += 1
			if first:
				print('first')
			elif second:
				print('second')
			elif a > 0:
				print('first')
			else:
				print('second')

		def solution(n, first, second, a):
			s1 = 0
			s2 = 0
			for i in range(len(first)):
				s1 += first[i]
			for j in range(len(second)):
				s2 += second[j]
			if s1 > s2:
				print('first')
			elif s1 < s2:
				print('second')
			else:
				winner(first, second, a)

		def read():
			n = int(input())
			first = list()
			second = list()
			a = 0
			for i in range(n):
				a = int(input())
				if a > 0:
					first.append(a)
				else:
					second.append(-a)
			solution(n, first, second, a)
		if __name__ == '__main__':
			read()
	except EOFError:
		break


testcases = int(input())
firstarr = []
secarr = []
newarr = []
for testcase in range(testcases):
	elem = int(input())
	newarr.append(elem)
	if elem > 0:
		firstarr.append(elem)
	else:
		secarr.append(abs(elem))
sumfirst = sum(firstarr)
sumsec = sum(secarr)
nfirst = len(firstarr)
nsec = len(secarr)
if sumfirst > sumsec:
	print('first')
elif sumsec > sumfirst:
	print('second')
elif nfirst == nsec:
	flag = 0
	for i in range(nfirst):
		if firstarr[i] > secarr[i]:
			flag = 1
			break
		if firstarr[i] < secarr[i]:
			flag = 2
			break
	if flag == 1:
		print('first')
	elif flag == 2:
		print('second')
	elif newarr[-1] > 0:
		print('first')
	else:
		print('second')
else:
	minlen = min(nfirst, nsec)
	flag = 0
	for i in range(minlen):
		if firstarr[i] > secarr[i]:
			flag = 1
			break
		if firstarr[i] < secarr[i]:
			flag = 2
			break
	if flag == 1:
		print('first')
	elif flag == 2:
		print('second')
	elif newarr[-1] > 0:
		print('first')
	else:
		print('second')


n = int(input())
w1 = 0
w2 = 0
l1 = []
l2 = []
last1 = True
for i in range(n):
	t = int(input())
	if t > 0:
		w1 += t
		l1.append(t)
		last1 = True
	else:
		w2 += -t
		l2.append(-t)
		last1 = False
if w1 > w2:
	print('first')
	exit(0)
if w1 < w2:
	print('second')
	exit(0)
if l1 > l2:
	print('first')
elif l1 < l2:
	print('second')
elif last1:
	print('first')
else:
	print('second')


def input_split(f):
	return map(f, input().split())

def main():
	n = int(input())
	total = 0
	f = []
	s = []
	for i in range(n):
		p = int(input())
		total += p
		if p > 0:
			f.append(p)
		else:
			s.append(p)
	res = None
	if total == 0:
		for (fp, sp) in zip(f, s):
			if abs(fp) < abs(sp):
				res = 'second'
			elif abs(fp) > abs(sp):
				res = 'first'
			if res:
				break
		if not res:
			res = 'first' if p > 0 else 'second'
	elif total < 0:
		res = 'second'
	else:
		res = 'first'
	print(res)
main()


def is_same(l1, l2):
	if len(l1) == len(l2):
		for i in range(0, len(l1)):
			if l1[i] != l2[i]:
				if l1[i] > l2[i]:
					return 'first'
				else:
					return 'second'
		return True
	else:
		for i in range(0, min(len(l1), len(l2))):
			if l1[i] != l2[i]:
				if l1[i] > l2[i]:
					return 'first'
				else:
					return 'second'
t = int(input())
l1 = []
sum1 = 0
l2 = []
sum2 = 0
inp = 0
for i in range(0, t):
	inp = int(input())
	if inp < 0:
		sum2 += abs(inp)
		l2.append(abs(inp))
	else:
		sum1 += inp
		l1.append(inp)
if sum2 > sum1:
	print('second')
elif sum1 > sum2:
	print('first')
else:
	check = is_same(l1, l2)
	if check == True:
		if inp > 0:
			print('first')
		else:
			print('second')
	else:
		print(check)


n = int(input())
a = []
b = []
last_a = False
for t in range(n):
	inp = int(input())
	if inp > 0:
		a.append(inp)
		last_a = True
	else:
		b.append(inp)
		last_a = False
if sum(a) + sum(b) != 0:
	if sum(a) > abs(sum(b)):
		print('first')
	else:
		print('second')
else:
	ans = False
	for i in range(min(len(a), len(b))):
		if a[i] > abs(b[i]):
			ans = True
			print('first')
			break
		elif abs(b[i]) > a[i]:
			ans = True
			print('second')
			break
	if not ans:
		if last_a:
			print('first')
		else:
			print('second')


__author__ = 'Rajan'
n = int(input())
f = []
s = []
fsum = 0
ssum = 0
last = 0
while n > 0:
	n -= 1
	k = int(input())
	if n == 0:
		last = k
	if k < 0:
		ssum += -1 * k
		s.append(-1 * k)
	else:
		fsum += k
		f.append(k)
if fsum != ssum:
	if fsum > ssum:
		print('first')
	else:
		print('second')
elif f == s:
	if last > 0:
		print('first')
	else:
		print('second')
elif f > s:
	print('first')
else:
	print('second')


n = int(input())
b = []
v = []
g = []
for i in range(n):
	t = int(input())
	g.append(t)
	if t > 0:
		v.append(t)
	else:
		b.append(-t)
a = sum(v)
bb = sum(b)
if a > bb:
	print('first')
elif bb > a:
	print('second')
else:
	p = len(v)
	q = len(b)
	if p > q:
		ff = 0
		m = q
	elif q > p:
		ff = 1
		m = p
	else:
		ff = -1
		m = p
	fff = -1
	for j in range(m):
		if v[j] > b[j]:
			fff = 1
			break
		elif b[j] > v[j]:
			fff = 0
			break
	if fff == 1:
		print('first')
	elif fff == 0:
		print('second')
	elif ff == 1:
		print('first')
	elif ff == 0:
		print('second')
	elif g[-1] > 0:
		print('first')
	else:
		print('second')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ne = int(input())
p = []
n = []
for i in range(ne):
	var = int(input())
	if var < 0:
		n.append(var)
	else:
		p.append(var)
	if i == ne - 1:
		cnt = var
t = sum(p + n)
if t > 0:
	print('first')
elif t < 0:
	print('second')
else:
	i = 0
	j = 0
	f = 0
	while i < len(p) or j < len(n):
		if p[i] > -1 * n[j]:
			f = 1
			print('first')
			exit()
		elif p[i] < -1 * n[j]:
			f = 1
			print('second')
			exit()
		else:
			i += 1
			j += 1
	print('first' if cnt > 0 else 'second')


n = int(input())
a = []
b = []
for i in range(n):
	x = int(input())
	if i == n - 1:
		num = x
	if x > 0:
		a.append(x)
	else:
		b.append(abs(x))
sma = sum(a)
smb = sum(b)
if sma > smb:
	print('first')
elif sma < smb:
	print('second')
elif a == b:
	if x > 0:
		print('first')
	else:
		print('second')
else:
	for i in range(min(len(a), len(b))):
		if a[i] > b[i]:
			print('first')
			break
		elif a[i] < b[i]:
			print('second')
			break


__author__ = 'Rakshak.R.Hegde'
n = int(input())
(w1, w2) = ([], [])
while n:
	n -= 1
	pnts = int(input())
	if pnts > 0:
		w1.append(pnts)
	else:
		w2.append(-pnts)
(sw1, sw2) = (sum(w1), sum(w2))
if sw1 == sw2:
	if w1 == w2:
		first = pnts > 0
	else:
		first = w1 > w2
else:
	first = sw1 > sw2
print('first' if first else 'second')


def compare(a, b):
	l = min(len(a), len(b))
	flag = True
	for i in range(l):
		if a[i] > b[i]:
			return 1
			flag = False
			break
		elif a[i] < b[i]:
			return 2
			flag = False
			break
	if flag:
		if len(a) > len(b):
			return 1
		elif len(a) < len(b):
			return 2
		else:
			return 0
n = int(input())
first = []
second = []
winner = 1
for i in range(n):
	score = int(input())
	if score > 0:
		first.append(score)
	else:
		second.append(-score)
	if i == n - 1 and score > 0:
		winner = 0
if sum(first) > sum(second):
	print('first')
elif sum(first) < sum(second):
	print('second')
else:
	result = compare(first, second)
	if result == 1:
		print('first')
	elif result == 2:
		print('second')
	elif winner == 0:
		print('first')
	else:
		print('second')


n = int(input())
f = -1
psum = 0
nsum = 0
arr = []
for _ in range(n):
	a = int(input())
	if a < 0:
		nsum += -1 * a
	else:
		psum += a
	if f == -1:
		if len(arr) == 0:
			arr.append(a)
		elif arr[0] > 0:
			if a > 0:
				arr.append(a)
			elif a * -1 == arr[0]:
				arr.remove(arr[0])
			elif a * -1 > arr[0]:
				f = 2
			else:
				f = 1
		elif a < 0:
			arr.append(a)
		elif a == arr[0] * -1:
			arr.remove(arr[0])
		elif a > arr[0] * -1:
			f = 1
		else:
			f = 2
if nsum != psum:
	if nsum > psum:
		print('second')
	else:
		print('first')
elif f != -1:
	if f == 1:
		print('first')
	else:
		print('second')
elif a < 0:
	print('second')
else:
	print('first')


__author__ = 'Rakshak.R.Hegde'
n = int(input())
(w1, w2) = ([], [])
(w1pnts, w2pnts) = (0, 0)
lastByW1 = True
while n:
	n -= 1
	pnts = int(input())
	if pnts > 0:
		w1.append(pnts)
		w1pnts += pnts
		lastByW1 = True
	else:
		w2.append(-pnts)
		w2pnts -= pnts
		lastByW1 = False
if w1pnts == w2pnts:
	if w1 == w2:
		print('first' if lastByW1 else 'second')
	else:
		print('first' if w1 > w2 else 'second')
else:
	print('first' if w1pnts > w2pnts else 'second')


from __future__ import division, print_function
import math
import os
import sys
from sys import stdin, stdout
from io import BytesIO, IOBase
from itertools import accumulate
from collections import deque
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def regularbracket(t):
	p = 0
	for i in t:
		if i == '(':
			p += 1
		else:
			p -= 1
		if p < 0:
			return False
	else:
		if p > 0:
			return False
		else:
			return True

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def reverse1(string):
	pp = ''
	for i in string[::-1]:
		pp += i
	if pp == string:
		return True
	return False

def reverse2(list1):
	l = []
	for i in list1[::-1]:
		l.append(i)
	if l == list1:
		return True
	return False
import math

def mex(list1):
	p = max(list1) + 1
	for i in range(len(list1)):
		if list1[i] != i:
			p = i
			break
	return p

def main():
	n = int(input())
	a = []
	x = [0]
	y = [0]
	d = 0
	for i in range(n):
		temp = int(input())
		a.append(temp)
		if temp > 0:
			x.append(temp)
		else:
			y.append(-temp)
	s = sum(a)
	x.reverse()
	y.reverse()
	if s > 0:
		print('first')
	elif s < 0:
		print('second')
	else:
		while True:
			d = x.pop() - y.pop()
			if d != 0 or len(x) == 0 or len(y) == 0:
				break
		if d > 0:
			print('first')
		elif d < 0:
			print('second')
		elif a[-1] > 0:
			print('first')
		else:
			print('second')
main()


from sys import *
t = int(stdin.readline())
a = []
x = []
y = []
xl = 0
yl = 0
for _ in range(t):
	n = int(stdin.readline())
	a.append(n)
	if n > 0:
		x.append(n)
		xl += 1
	else:
		y.append(abs(n))
		yl += 1
if sum(x) > sum(y):
	print('first')
elif sum(x) < sum(y):
	print('second')
else:
	m = min(xl, yl)
	f = 0
	for i in range(m):
		if x[i] > y[i]:
			f = 1
			break
		elif x[i] < y[i]:
			f = 2
			break
	if f == 1:
		print('first')
	elif f == 2:
		print('second')
	elif a[t - 1] > 0:
		print('first')
	else:
		print('second')


n = int(input())
a = []
b = []
c = []
for i in range(n):
	t = int(input())
	if t > 0:
		a.append(abs(t))
	else:
		b.append(abs(t))
	c.append(t)
if sum(a) > sum(b):
	print('first')
elif sum(a) < sum(b):
	print('second')
else:
	flag = 0
	for i in range(min(len(a), len(b))):
		if a[i] < b[i]:
			flag = 1
			break
		elif a[i] > b[i]:
			flag = 2
			break
	if flag == 1:
		print('second')
		exit()
	if flag == 2:
		print('first')
		exit()
	a = ''.join((str(e) for e in a))
	b = ''.join((str(e) for e in b))
	if a == b:
		if c[-1] < 0:
			print('second')
		else:
			print('first')
	elif a > b:
		print('first')


n = int(input())
f = []
s = []
for i in range(n):
	x = int(input())
	if x > 0:
		f.append(x)
	else:
		s.append(abs(x))
	if i == n - 1:
		if x > 0:
			lst = 'first'
		else:
			lst = 'second'
if sum(f) > sum(s):
	print('first')
elif sum(s) > sum(f):
	print('second')
else:
	for i in range(min(len(f), len(s))):
		if f[i] > s[i]:
			print('first')
			exit()
		elif s[i] > f[i]:
			print('second')
			exit()
	if len(f) > len(s):
		print('first')
	elif len(s) > len(f):
		print('second')
	else:
		print(lst)


def compare(s1, s2):
	ind = False
	for i in range(max(len(s1), len(s2))):
		if s1[i] > s2[i]:
			ind = True
			return 's1'
		elif s2[i] > s1[i]:
			ind = True
			return 's2'
	if len(s1) > len(s2):
		return 's1'
	elif len(s1) < len(s2):
		return 's2'
	else:
		return 'False'
n = int(input())
L = [input() for i in range(n)]
first = []
second = []
for s in L:
	if s[0] == '-':
		second.append(int(s) * -1)
	else:
		first.append(int(s))
if sum(first) > sum(second):
	print('first')
elif sum(first) < sum(second):
	print('second')
else:
	res = compare(first, second)
	if res == 's1':
		print('first')
	elif res == 's2':
		print('second')
	elif int(L[-1]) >= 0:
		print('first')
	else:
		print('second')


n = int(input())
a = []
b = []
last = 0
for i in range(n):
	q = int(input())
	if q > 0:
		a.append(q)
		last = 1
	else:
		b.append(-q)
		last = 2
sum1 = sum(a)
sum2 = sum(b)
if sum1 > sum2:
	print('first')
elif sum1 < sum2:
	print('second')
elif a > b:
	print('first')
elif b > a:
	print('second')
else:
	if last == 1:
		print('first')
	if last == 2:
		print('second')


num = int(input())
s1 = []
s2 = []
last = 1
for i in range(0, num):
	s = int(input())
	if s > 0:
		s1.append(s)
		last = 1
	else:
		s2.append(-s)
		last = 2
if sum(s1) > sum(s2):
	print('first')
elif sum(s1) < sum(s2):
	print('second')
elif s1 > s2:
	print('first')
elif s1 < s2:
	print('second')
elif last == 1:
	print('first')
else:
	print('second')


n = int(input())
l1 = []
l2 = []
for i in range(n):
	a = int(input())
	if a > 0:
		l1.append(a)
	else:
		l2.append(abs(a))
if sum(l1) > sum(l2):
	print('first')
elif sum(l2) > sum(l1):
	print('second')
else:
	leng = min(len(l1), len(l2))
	k = -1
	if len(l1) > len(l2):
		k = 1
	elif len(l1) < len(l2):
		k = 2
	for i in range(leng):
		if l1[i] > l2[i]:
			k = 1
			break
		elif l1[i] < l2[i]:
			k = 2
			break
	if k == -1:
		if a > 0:
			print('first')
		else:
			print('second')
	elif k == 1:
		print('first')
	else:
		print('second')


from sys import stdin
input = stdin.readline

def wrestler(one, two):
	s1 = sum(one)
	s2 = sum(two)
	if s1 > s2:
		return 'first'
	if s2 > s1:
		return 'second'
	elif two > one:
		return 'second'
	else:
		return 'first'
ls = []
ls2 = []
flag = True
for i in range(int(input())):
	a = int(input())
	if a < 0:
		ls2.append(abs(a))
		flag = False
	else:
		ls.append(abs(a))
		flag = True
if ls == ls2:
	if flag:
		print('first')
	else:
		print('second')
else:
	print(wrestler(ls, ls2))


n = int(input())
lstAtk = ''
player1 = []
player2 = []
for i in range(n):
	x = int(input())
	if x > 0:
		player1.append(x)
	else:
		player2.append(abs(x))
	if i == n - 1:
		if x > 0:
			lstAtk = 'first'
		else:
			lstAtk = 'second'
if sum(player1) > sum(player2):
	print('first')
elif sum(player2) > sum(player1):
	print('second')
else:
	for i in range(min(len(player1), len(player2))):
		if player1[i] > player2[i]:
			print('first')
			exit()
		elif player2[i] > player1[i]:
			print('second')
			exit()
	if len(player1) > len(player2):
		print('first')
	elif len(player2) > len(player1):
		print('second')
	else:
		print(lstAtk)


import time

def test(s1, s2):
	for i in range(min(len(s1), len(s2))):
		if s1[i] > s2[i]:
			return 1
		if s1[i] < s2[i]:
			return -1
	if len(s1) > len(s2):
		return 1
	elif len(s1) < len(s2):
		return -1
	else:
		return 0
n = int(input())
first = []
second = []
sum = 0
start = time.time()
for i in range(n):
	k = int(input())
	if k >= 0:
		first.append(k)
	else:
		second.append(-k)
	sum += k
if sum > 0:
	print('first')
elif sum < 0:
	print('second')
else:
	t = test(first, second)
	if t == 1:
		print('first')
	elif t == -1:
		print('second')
	elif k > 0:
		print('first')
	else:
		print('second')
finish = time.time()


n = int(input())
first = []
second = []
last = 0
for i in range(n):
	a = int(input())
	if a > 0:
		first.append(a)
	else:
		second.append(abs(a))
	if i == n - 1:
		last = a
if abs(sum(first)) > abs(sum(second)):
	print('first')
	quit()
if abs(sum(first)) < abs(sum(second)):
	print('second')
else:
	if first > second:
		print('first')
		quit()
	if first < second:
		print('second')
	elif last > 0:
		print('first')
	else:
		print('second')


F = 'first'
S = 'second'
R = range
f = []
s = []
b = ''
c = ''
for _ in R(int(input())):
	a = int(input())
	if a > 0:
		f.append(a)
		c = F
	else:
		s.append(-a)
		c = S
a = ''
t = sum(f) - sum(s)
if t > 0:
	a = F
if t < 0:
	a = S
m = min(len(f), len(s))
for i in R(m):
	t = f[i] - s[i]
	if t > 0:
		b = F
	if t < 0:
		b = S
	if b:
		break
print(a or b or c)


n = int(input())
arr1 = []
arr2 = []
tot = []
for _ in range(n):
	temp = int(input())
	if temp > 0:
		arr1.append(temp)
	else:
		arr2.append(abs(temp))
	tot.append(temp)
if sum(arr1) > sum(arr2):
	print('first')
elif sum(arr2) > sum(arr1):
	print('second')
elif arr1 < arr2:
	print('second')
elif arr2 < arr1:
	print('first')
elif tot[-1] < 0:
	print('second')
else:
	print('first')


import sys
input = sys.stdin.buffer.readline
import os
t = int(input())
arr = []
brr = []
last = 0
while t:
	t -= 1
	n = int(input())
	last = n
	if n < 0:
		brr.append(-n)
	else:
		arr.append(n)
if sum(arr) > sum(brr):
	print('first')
elif sum(arr) < sum(brr):
	print('second')
else:
	z = ''
	for i in range(min(len(arr), len(brr))):
		if arr[i] > brr[i]:
			z = 'first'
			break
		elif arr[i] < brr[i]:
			z = 'second'
			break
	if z == '':
		if last < 0:
			print('second')
		else:
			print('first')
	else:
		print(z)


def lex_cmp(seq1, seq2):
	for (p1, p2) in zip(seq1, seq2):
		if p1 > p2:
			return 1
		elif p1 < p2:
			return -1
	if p1 is None:
		return -1
	elif p2 is None:
		return 1
	else:
		return 0

def main():
	n = int(input())
	p1 = p2 = 0
	(seq1, seq2) = ([], [])
	for _ in range(n):
		points = input()
		p = int(points)
		if p > 0:
			p1 += p
			seq1.append(p)
		else:
			p2 -= p
			seq2.append(-p)
	if p1 > p2:
		print('first')
	elif p1 < p2:
		print('second')
	elif lex_cmp(seq1, seq2) == 1:
		print('first')
	elif lex_cmp(seq1, seq2) == -1:
		print('second')
	else:
		print('second' if p < 0 else 'first')
main()


(first_attacks, second_attacks, last_kick) = ([], [], 0)
for i in range(int(input())):
	kick = int(input())
	if kick > 0:
		first_attacks.append(kick)
	else:
		second_attacks.append(-kick)
	last_kick = kick
(sum_first, sum_second) = (sum(first_attacks), sum(second_attacks))
if sum_first > sum_second:
	print('first')
elif sum_second > sum_first:
	print('second')
elif first_attacks > second_attacks:
	print('first')
elif second_attacks > first_attacks:
	print('second')
elif last_kick > 0:
	print('first')
else:
	print('second')


n = int(input())
first = [0]
second = [0]
sum_first = 0
sum_second = 0
last_hit = False
for i in range(n):
	inp = int(input())
	if inp > 0:
		first.append(inp)
		sum_first += inp
		last_hit = True
	else:
		second.append(inp * -1)
		sum_second += inp * -1
		last_hit = False
if sum_first > sum_second:
	print('first')
elif sum_second > sum_first:
	print('second')
elif first > second:
	print('first')
elif second > first:
	print('second')
elif last_hit:
	print('first')
else:
	print('second')


def main():
	first = []
	second = []
	n = int(input())
	for i in range(n):
		score = int(input())
		if score > 0:
			first.append(score)
		else:
			second.append(abs(score))
	if sum(first) > sum(second):
		print('first')
	elif sum(second) > sum(first):
		print('second')
	else:
		winner = ''
		for i in range(min(len(first), len(second))):
			if second[i] > first[i]:
				winner = 'second'
				break
			elif first[i] > second[i]:
				winner = 'first'
				break
		if not winner:
			if score > 0:
				winner = 'first'
			else:
				winner = 'second'
		print(winner)
main()


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

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

def check_order(first, second):
	len1 = len(first)
	len2 = len(second)
	i = j = 0
	while i < len1 and j < len2:
		if first[i] == second[j]:
			i += 1
			j += 1
		elif first[i] > second[j]:
			return 'first'
		else:
			return 'second'
	return 'no'
n = int(input())
first = []
second = []
last = 0
for i in range(n):
	x = int(input())
	if x > 0:
		first.append(x)
		last = 1
	else:
		second.append(abs(x))
		last = 2
if sum(first) != sum(second):
	if sum(first) > sum(second):
		print('first')
	else:
		print('second')
else:
	ans = check_order(first, second)
	if ans != 'no':
		print(ans)
	elif last == 1:
		print('first')
	else:
		print('second')


n = int(input())
l1 = []
l2 = []
(sum1, sum2) = (0, 0)
last = 0
for i in range(n):
	k = int(input())
	if k > 0:
		sum1 += k
		l1.append(k)
		last = 1
	else:
		sum2 += abs(k)
		l2.append(abs(k))
		last = 2
if sum1 > sum2:
	print('first')
elif sum2 > sum1:
	print('second')
else:
	for i in range(max(len(l1), len(l2))):
		if i < len(l1):
			a = l1[i]
		else:
			a = 0
		if i < len(l2):
			b = l2[i]
		else:
			b = 0
		if a > b:
			ans = 1
			break
		elif b > a:
			ans = 2
			break
		else:
			ans = last
	if ans == 1:
		print('first')
	elif ans == 2:
		print('second')


n = int(input())
(a, b) = ([], [])
diff = 0
for i in range(n):
	move = int(input())
	diff += move
	if move < 0:
		b.append(-move)
	else:
		a.append(move)
if diff > 0:
	print('first')
elif diff < 0:
	print('second')
elif a > b:
	print('first')
elif b > a:
	print('second')
elif move > 0:
	print('first')
else:
	print('second')


n = int(input())
ff = []
ss = []
f = 0
s = 0
l = ''
for i in range(n):
	x = int(input())
	if x < 0:
		ss.append(-x)
		if i == n - 1:
			l = 'second'
	else:
		ff.append(x)
		if i == n - 1:
			l = 'first'
s = sum(ss)
f = sum(ff)
if f > s:
	print('first')
elif s > f:
	print('second')
elif ff > ss:
	print('first')
elif ss > ff:
	print('second')
else:
	print(l)


n = int(input())
s0 = s1 = 0
l0 = l1 = 0
(a0, a1) = ([], [])
for i in range(n):
	x = int(input())
	if x >= 0:
		a0.append(x)
		l0 = i
		s0 += x
	else:
		a1.append(abs(x))
		l1 = i
		s1 += abs(x)
print('first' if (s0, a0, l0) > (s1, a1, l1) else 'second')


n = int(input())
a = [int(input()) for _ in range(n)]
(u, v) = ([], [])
t = 0
for i in a:
	if i > 0:
		u.append(i)
		t = 0
	else:
		v.append(-i)
		t = 1
if sum(u) != sum(v):
	print(['second', 'first'][sum(u) > sum(v)])
elif u != v:
	print(['second', 'first'][u > v])
else:
	print(['first', 'second'][t])


n = int(input())
first = []
second = []
for _ in range(n):
	score = int(input())
	if score > 0:
		first.append(score)
		last = 'first'
	else:
		second.append(abs(score))
		last = 'second'
score_a = sum(first)
score_b = sum(second)
if score_a > score_b:
	print('first')
elif score_a < score_b:
	print('second')
else:
	for i in range(min(len(first), len(second))):
		if first[i] > second[i]:
			print('first')
			break
		elif first[i] < second[i]:
			print('second')
			break
	else:
		if len(first) > len(second):
			print('first')
		elif len(first) < len(second):
			print('second')
		else:
			print(last)


p = input()
p = int(p)
a = list()
b = list()
f = 0
s = 0
for i in range(p):
	x = input()
	x = int(x)
	if x > 0:
		f += x
		a.append(x)
	else:
		y = -x
		s += y
		b.append(y)
if f > s:
	print('first')
elif f < s:
	print('second')
elif a > b:
	print('first')
elif a < b:
	print('second')
elif x > 0:
	print('first')
else:
	print('second')


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.setrecursionlimit(int(pow(10, 6)))
	sys.stdin = open('input.txt', 'r')
except:
	pass
n = L()[0]
A = []
B = []
ans = 0
for i in range(n):
	x = L()[0]
	if x > 0:
		A.append(x)
	else:
		B.append(-x)
	ans += x
	if i == n - 1:
		last = x
if ans > 0:
	print('first')
elif ans < 0:
	print('second')
elif A > B:
	print('first')
elif B > A:
	print('second')
elif last > 0:
	print('first')
else:
	print('second')
endtime = time.time()


n = int(input())
c = 0
d = 0
c1 = []
d1 = []
f = 0
for i in range(n):
	k = int(input())
	if k > 0:
		c1.append(k)
		c += k
		if i == n - 1:
			f = 1
	else:
		k = -1 * k
		d1.append(k)
		d += k
		if i == n - 1:
			f = 2
if c > d:
	print('first')
elif c < d:
	print('second')
else:
	s = 0
	for i in range(min(len(c1), len(d1))):
		if c1[i] < d1[i]:
			print('second')
			s = 1
			break
		elif c1[i] > d1[i]:
			print('first')
			s = 1
			break
	if s == 0:
		if f == 1:
			print('first')
		else:
			print('second')


n = int(input())
first_moves = []
second_moves = []
last = None
for i in range(n):
	move = int(input())
	if move > 0:
		first_moves.append(move)
	else:
		second_moves.append(-move)
	if i == n - 1:
		last = move
first_score = sum(first_moves)
second_score = sum(second_moves)
if first_score > second_score:
	print('first')
elif second_score > first_score:
	print('second')
elif first_moves > second_moves:
	print('first')
elif second_moves > first_moves:
	print('second')
elif last > 0:
	print('first')
else:
	print('second')


def who(a, b):
	for i in range(min(len(a), len(b))):
		if a[i] > b[i]:
			return 'first'
		if a[i] < b[i]:
			return 'second'
	if len(a) < len(b):
		return 'first'
	return 'second'
(f, s, t) = ([], [], 0)
for _ in range(int(input())):
	n = int(input())
	if n < 0:
		s.append(-n)
	else:
		f.append(n)
	t = n
if sum(s) == sum(f):
	if s == f:
		print('first' if t > 0 else 'second')
	else:
		print(who(f, s))
elif sum(s) < sum(f):
	print('first')
else:
	print('second')


import sys, os, io

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

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout
from heapq import heappush, heappop, heapify, _heapify_max, _heappop_max, nsmallest, nlargest
sys.setrecursionlimit(111111)
INF = 99999999999999999999999999999999

def main():
	mod = 1000000007
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	tc = 1
	for _ in range(tc):
		n = ri()
		player1 = 0
		player2 = 0
		p1 = []
		p2 = []
		lp = -1
		for i in range(n):
			score = ri()
			if score > 0:
				player1 += score
				p1.append(score)
				lp = 1
			else:
				player2 -= score
				p2.append(-score)
				lp = 2
		if player1 > player2:
			print('first')
		elif player2 > player1:
			print('second')
		elif p1 > p2:
			print('first')
		elif p2 > p1:
			print('second')
		elif lp == 1:
			print('first')
		else:
			print('second')
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


(f, s) = ([], [])
last = -1
p = int(input())
for i in range(p):
	n = int(input())
	if n > 0:
		f.append(n)
	else:
		s.append(-1 * n)
	if i == p - 1:
		last = n
(fs, ss) = (sum(f), sum(s))
if fs > ss:
	print('first')
elif ss > fs:
	print('second')
else:
	l = min(len(f), len(s))
	for i in range(len(f)):
		if f[i] > s[i]:
			print('first')
			break
		elif s[i] > f[i]:
			print('second')
			break
	else:
		if len(f) > len(s):
			print('first')
		elif len(s) > len(f):
			print('second')
		elif last > 0:
			print('first')
		else:
			print('second')


n = int(input())
lpos = []
lneg = []
l = []
a = 0
b = 0
for i in range(n):
	x = int(input())
	if x > 0:
		a += x
		lpos.append(x)
	else:
		b += abs(x)
		lneg.append(x)
	l.append(x)
if a > b:
	print('first')
elif b > a:
	print('second')
else:
	for i in range(min(len(lpos), len(lneg))):
		if lpos[i] > abs(lneg[i]):
			print('first')
			quit()
		elif abs(lneg[i]) > lpos[i]:
			print('second')
			quit()
	if l[-1] > 0:
		print('first')
	else:
		print('second')


n = int(input())
first = []
second = []
d = []
for i in range(n):
	k = int(input())
	d.append(k)
	if k > 0:
		first.append(k)
	else:
		second.append(abs(k))
tot_fir = sum(first)
tot_sec = sum(second)
if tot_fir > tot_sec:
	print('first')
	exit()
elif tot_sec > tot_fir:
	print('second')
	exit()
elif first == second:
	if d[n - 1] < 0:
		print('second')
		exit()
	else:
		print('first')
		exit()
len_fir = len(first)
len_sec = len(second)
min_len = min(len_fir, len_sec)
for i in range(min_len):
	if first[i] > second[i]:
		print('first')
		exit()
	elif first[i] < second[i]:
		print('second')
		exit()
if len_sec > len_fir:
	print('second')
else:
	print('first')


import sys
input = sys.stdin.readline
read_tuple = lambda _type: map(_type, input().split(' '))
from fractions import Fraction as frac

def solve():
	n = int(input())
	(a1, a2) = ([], [])
	_sum = 0
	latest = None
	for _ in range(n):
		a_i = int(input())
		_sum += a_i
		if a_i > 0:
			a1.append(a_i)
			latest = 'first'
		else:
			a2.append(-a_i)
			latest = 'second'
	if _sum > 0:
		return 'first'
	if _sum < 0:
		return 'second'
	if a1 > a2:
		return 'first'
	if a2 > a1:
		return 'second'
	return latest
print(solve())


n = int(input())
player1 = []
player2 = []
sum_1 = 0
sum_2 = 0
last_el = 0
for i in range(n):
	move = int(input())
	if i == n - 1:
		last_el = move
	if move >= 0:
		sum_1 += move
		player1.append(move)
	else:
		move *= -1
		sum_2 += move
		player2.append(move)
if sum_1 > sum_2:
	print('first')
elif sum_1 < sum_2:
	print('second')
elif player1 > player2:
	print('first')
elif player1 < player2:
	print('second')
elif last_el > 0:
	print('first')
else:
	print('second')


n = int(input())
x = []
first = []
second = []
last = 0
sum_first = 0
sum_second = 0
winner = ''
for i in range(n):
	b = int(input())
	if b > 0:
		first += [b]
	elif b < 0:
		second += [abs(b)]
	if i == n - 1:
		last = b
sum_first = sum(first)
sum_second = sum(second)
if sum_first > sum_second:
	winner = 'first'
elif sum_first < sum_second:
	winner = 'second'
elif sum_first == sum_second:
	if first > second:
		winner = 'first'
	elif second > first:
		winner = 'second'
	elif last > 0:
		winner = 'first'
	else:
		winner = 'second'
print(winner)


n = int(input())
player1 = []
player2 = []
arr = []
while n:
	n -= 1
	a = int(input())
	arr.append(a)
	if a > 0:
		player1.append(a)
	else:
		player2.append(-a)
if sum(player1) != sum(player2):
	if sum(player1) > sum(player2):
		print('first')
	else:
		print('second')
elif player1 != player2:
	if player2 > player1:
		print('second')
	else:
		print('first')
elif arr[-1] > 0:
	print('first')
else:
	print('second')


n = int(input())
lastinp = 0
sums1 = 0
sums2 = 0
l = []
r = []
for i in range(0, n):
	x = int(input())
	if x > 0:
		sums1 += x
		l.append(x)
	else:
		sums2 += abs(x)
		r.append(abs(x))
	lastinp = x
flag = -1
if sums1 < sums2:
	print('second')
elif sums1 > sums2:
	print('first')
else:
	for i in range(0, min(len(l), len(r))):
		if l[i] > r[i]:
			flag = 0
			break
		elif l[i] < r[i]:
			flag = 1
			break
	if flag == -1:
		if len(l) != len(r) and len(l) > len(r):
			print('first')
		elif len(l) != len(r) and len(l) > len(r):
			print('second')
		elif lastinp < 0:
			print('second')
		else:
			print('first')
	elif flag == 0:
		print('first')
	else:
		print('second')


n = int(input())
(x, y) = ([], [])
z = 0
for i in range(n):
	m = int(input())
	if m > 0:
		z = 1
		x.append(m)
	else:
		z = -1
		y.append(-m)
if sum(x) != sum(y):
	print('first' if sum(x) > sum(y) else 'second')
elif x != y:
	print('first' if x > y else 'second')
else:
	print('first' if z > 0 else 'second')


n = int(input())
a = []
b = []
asum = 0
bsum = 0
temp = 0
for i in range(n):
	temp = int(input())
	if temp > 0:
		asum += temp
		a.append(temp)
	else:
		bsum += -temp
		b.append(-temp)
if asum != bsum:
	print('first') if asum > bsum else print('second')
elif a == b:
	print('first') if temp > 0 else print('second')
else:
	print('first') if a > b else print('second')


n = int(input())
a = []
b = []
sum_a = 0
sum_b = 0
last = ''
for i in range(n):
	x = int(input())
	if x > 0:
		sum_a += x
		a.append(x)
		last = 'first'
	else:
		sum_b -= x
		b.append(-x)
		last = 'second'
if sum_a > sum_b:
	print('first')
elif sum_b > sum_a:
	print('second')
elif a > b:
	print('first')
elif b > a:
	print('second')
else:
	print(last)


sum1 = 0
sum2 = 0
list1 = []
list2 = []
last = 0
n = int(input())
for i in range(n):
	val = int(input())
	if val > 0:
		sum1 += val
		list1.append(val)
		last = 1
	else:
		sum2 += -val
		list2.append(-val)
		last = -1
if sum1 > sum2:
	print('first')
	return
elif sum1 < sum2:
	print('second')
	return
for i in range(min(len(list1), len(list2))):
	if list1[i] > list2[i]:
		print('first')
		return
	elif list1[i] < list2[i]:
		print('second')
		return
if len(list1) > len(list2):
	print('first')
	return
elif len(list1) < len(list2):
	print('second')
	return
if last > 0:
	print('first')
else:
	print('second')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l

def sq(a, target, arr=[]):
	s = sum(arr)
	if s == target:
		return arr
	if s >= target:
		return
	for i in range(len(a)):
		n = a[i]
		remaining = a[i + 1:]
		ans = sq(remaining, target, arr + [n])
		if ans:
			return ans

def SieveOfEratosthenes(n):
	cnt = 0
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			cnt += 1
	return cnt

def nCr(n, r):
	f = math.factorial
	return f(n) // f(r) // f(n - r)
mod = int(1000000000.0) + 7

def ssinp():
	return input()

def iinp():
	return int(input())

def nninp():
	return map(int, input().split())

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

def p(xyz):
	print(xyz)

def p2(a, b):
	print(a, b)
import math
from collections import OrderedDict
n = iinp()
w1 = []
w2 = []
nos = 0
for i in range(n):
	a = iinp()
	if i == n - 1:
		nos = a
	if a > 0:
		w1.append(a)
	else:
		w2.append(abs(a))
if sum(w1) > sum(w2):
	print('first')
elif sum(w2) > sum(w1):
	print('second')
else:
	for i in range(min(len(w1), len(w2))):
		if w1[i] > w2[i]:
			print('first')
			exit()
		elif w2[i] > w1[i]:
			print('second')
			exit()
	if len(w1) > len(w2):
		print('first')
	elif len(w2) > len(w1):
		print('second')
	elif nos > 0:
		print('first')
	else:
		print('second')


import sys

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

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
n = iinput()
first = []
second = []
sum_first = 0
sum_second = 0
last_move = ''
for i in range(n):
	k = iinput()
	if k > 0:
		first.append(k)
		sum_first += k
	else:
		second.append(abs(k))
		sum_second += abs(k)
	if i == n - 1:
		if k > 0:
			last_move = 'first'
		else:
			last_move = 'second'
if sum_first > sum_second:
	print('first')
elif sum_first < sum_second:
	print('second')
elif len(first) > len(second):
	if first[:len(second)] == second:
		print('first')
	else:
		for i in range(len(second)):
			if first[i] > second[i]:
				print('first')
				break
			elif first[i] < second[i]:
				print('second')
				break
		else:
			print(last_move)
elif len(first) < len(second):
	if first == second[:len(first)]:
		print('second')
	else:
		for i in range(len(first)):
			if first[i] > second[i]:
				print('first')
				break
			elif first[i] < second[i]:
				print('second')
				break
		else:
			print(last_move)
else:
	for i in range(len(first)):
		if first[i] > second[i]:
			print('first')
			break
		elif first[i] < second[i]:
			print('second')
			break
	else:
		print(last_move)


import sys
n = int(sys.stdin.readline())
last = 'first'
a = []
b = []
suma = 0
sumb = 0
for i in range(n):
	x = int(sys.stdin.readline())
	if x > 0:
		last = 'first'
		a.append(x)
		suma += x
	else:
		last = 'second'
		b.append(-x)
		sumb += -x
if suma > sumb:
	sys.stdout.write('first')
	quit()
if suma < sumb:
	sys.stdout.write('second')
	quit()
for i in range(min(len(a), len(b))):
	if a[i] > b[i]:
		sys.stdout.write('first')
		quit()
	elif a[i] < b[i]:
		sys.stdout.write('second')
		quit()
if len(a) > len(b):
	sys.stdout.write('first')
elif len(a) < len(b):
	sys.stdout.write('second')
else:
	sys.stdout.write(last)


n = int(input())
a1 = []
a2 = []
sm1 = 0
sm2 = 0
for i in range(n):
	a = int(input())
	if a > 0:
		a1.append(a)
		sm1 += a
		last = 'first'
	else:
		a = abs(a)
		a2.append(a)
		sm2 += a
		last = 'second'
if sm1 == sm2:
	if a1 > a2:
		print('first')
	elif a2 > a1:
		print('second')
	else:
		print(last)
elif sm1 > sm2:
	print('first')
else:
	print('second')


points = int(input())
firstpoints = []
secondpoints = []
ans = 'k'
for s in range(points):
	point = int(input())
	if point > 0:
		firstpoints.append(int(point))
	elif point < 0:
		secondpoints.append(int(point))
	if s == points - 1 and point > 0:
		ans = 'l'
if sum(firstpoints) == abs(sum(secondpoints)):
	for i in range(max(len(firstpoints), len(secondpoints))):
		if firstpoints[i] > abs(secondpoints[i]):
			print('first')
			break
		elif firstpoints[i] < abs(secondpoints[i]):
			print('second')
			break
		elif i == min(len(firstpoints), len(secondpoints)) - 1:
			if ans == 'l':
				print('first')
				break
			else:
				print('second')
				break
elif sum(firstpoints) > abs(sum(secondpoints)):
	print('first')
else:
	print('second')


n = int(input())
first = [0] * n
second = [0] * n
last = 0
i1 = 0
i2 = 0
for i in range(n):
	k = int(input())
	if k > 0:
		first[i1] = k
		i1 += 1
	else:
		second[i2] = abs(k)
		i2 += 1
	if i == n - 1:
		last = k
s1 = sum(first)
s2 = sum(second)
if s1 > s2:
	print('first')
elif s2 > s1:
	print('second')
else:
	for i in range(n):
		if first[i] != second[i]:
			print('first' if first[i] > second[i] else 'second')
			break
	else:
		print('first' if last > 0 else 'second')


n = int(input())
wrest1 = []
wrest2 = []
sum1 = 0
sum2 = 0
l = 0
for i in range(n):
	a = int(input())
	if a > 0:
		wrest1.append(a)
		sum1 += a
		l = 'first'
	else:
		a = -a
		wrest2.append(a)
		sum2 += a
		l = 'second'
if sum1 > sum2:
	print('first')
elif sum2 > sum1:
	print('second')
else:
	winner = 0
	for i in range(min(len(wrest1), len(wrest2))):
		if wrest1[i] > wrest2[i]:
			winner = 1
			break
		elif wrest2[i] > wrest1[i]:
			winner = -1
			break
	if winner == 1:
		print('first')
	elif winner == -1:
		print('second')
	else:
		print(l)


import os
import sys
from math import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return map(int, input().split())

def array():
	return [int(i) for i in input().split()]
(first, second) = (0, 0)
f = []
s = []
for _ in range(int(input())):
	k = int(input())
	if k > 0:
		first += k
		f.append(k)
	else:
		second += k * -1
		s.append(k * -1)
if first > second:
	print('first')
elif second > first:
	print('second')
elif f > s:
	print('first')
elif f < s:
	print('second')
elif k > 0:
	print('first')
else:
	print('second')


n = int(input())
p = 0
s1 = list()
s2 = list()
l = 0
for s in list((input() for _ in range(n))):
	p += int(s)
	(s1 if int(s) > 0 else s2).append(abs(int(s)))
	l = 1 if int(s) > 0 else -1
if p != 0:
	print('first' if p > 0 else 'second')
	quit()
if s1 != s2:
	print('first' if s1 > s2 else 'second')
else:
	print('first' if l == 1 else 'second')


(first, second) = ([], [])
for i in range(int(input())):
	a = int(input())
	if a > 0:
		first.append(a)
	else:
		second.append(-a)
	last = a
if sum(first) > sum(second):
	print('first')
elif sum(second) > sum(first):
	print('second')
else:
	for i in range(min(len(first), len(second))):
		if first[i] > second[i]:
			print('first')
			raise SystemExit
		if second[i] > first[i]:
			print('second')
			raise SystemExit
	if len(first) > len(second):
		print('first')
	elif len(second) > len(first):
		print('second')
	else:
		print('first' if last > 0 else 'second')


from sys import stdin, stdout

def main():
	n = int(stdin.readline().strip())
	a = []
	a_sum = 0
	b = []
	b_sum = 0
	last = 'first'
	for i in range(n):
		x = int(stdin.readline().strip())
		if x > 0:
			a.append(str(x))
			a_sum += x
			last = 'first'
		else:
			x = -x
			b.append(str(x))
			b_sum += x
			last = 'second'
	if a_sum > b_sum:
		return 'first'
	if b_sum > a_sum:
		return 'second'
	if a_sum == b_sum and len(a) == len(b):
		c = 0
		for i in range(len(a)):
			if a[i] == b[i]:
				c += 1
			else:
				break
		if c == len(a) and c == len(b):
			return last
	for i in range(min(len(a), len(b))):
		if a[i] == b[i]:
			continue
		if int(a[i]) < int(b[i]):
			return 'second'
		else:
			return 'first'
	if a > b:
		return 'first'
	return 'second'
stdout.write('{}\n'.format(main()))


n = int(input())
f = []
s = []
(a, b) = (0, 0)
(p, q) = (0, 0)
for i in range(n):
	x = int(input())
	if x > 0:
		f.append(x)
		a += x
		p += 1
	else:
		s.append(-x)
		b -= x
		q += 1
if a > b:
	print('first')
	exit()
if b > a:
	print('second')
	exit()
for i in range(min(p, q)):
	if f[i] > s[i]:
		print('first')
		exit()
	elif s[i] > f[i]:
		print('second')
		exit()
if x > 0:
	print('first')
else:
	print('second')


def read_input():
	n = int(input())
	w1 = []
	w2 = []
	num = 0
	for _ in range(n):
		num = int(input())
		if num > 0:
			w1.append(num)
		elif num < 0:
			w2.append(-num)
	if sum(w1) > sum(w2):
		return 'first'
	elif sum(w1) < sum(w2):
		return 'second'
	if sum(w1) == sum(w2):
		if w1 == w2:
			if num > 0:
				return 'first'
			elif num < 0:
				return 'second'
		elif w1 > w2:
			return 'first'
		else:
			return 'second'
ans = read_input()
print(ans)


n = int(input())
w1 = []
w2 = []
first_was_last = True
for _ in range(n):
	a = int(input())
	if a > 0:
		w1.append(a)
		first_was_last = True
	else:
		w2.append(abs(a))
		first_was_last = False
n1 = len(w1)
n2 = len(w2)
t1 = sum(w1)
t2 = sum(w2)
if t1 > t2:
	print('first')
elif t1 < t2:
	print('second')
else:
	has_winner = False
	for i in range(min(n1, n2)):
		if w1[i] > w2[i]:
			print('first')
			has_winner = True
			break
		elif w1[i] < w2[i]:
			print('second')
			has_winner = True
			break
	if not has_winner:
		if n1 > n2:
			print('first')
		elif n1 < n2:
			print('second')
		elif first_was_last:
			print('first')
		else:
			print('second')


f = 0
lef = []
n = int(input())
s = 0
les = []
last = 0
for i in range(n):
	x = int(input())
	if x > 0:
		last = 1
		lef.append(x)
		f += x
	else:
		last = 3
		les.append(-x)
		s += abs(x)
if f > s:
	print('first')
	exit()
if f < s:
	print('second')
	exit()
if lef > les:
	print('first')
	exit()
if lef < les:
	print('second')
	exit()
if last == 1:
	print('first')
	exit()
print('second')


n = int(input())
a = []
b = []
for i in range(n):
	x = int(input())
	if x > 0:
		a.append(x)
	else:
		b.append(-x)
	last = x
suma = sum(a)
sumb = sum(b)
if suma > sumb:
	print('first')
elif suma < sumb:
	print('second')
else:
	lena = len(a)
	lenb = len(b)
	i = j = f = 0
	while i < lena and j < lenb:
		if a[i] > b[j]:
			f = 1
			break
		elif a[i] < b[j]:
			f = 2
			break
		i += 1
		j += 1
	if f == 1:
		print('first')
	elif f == 2:
		print('second')
	elif lena > lenb:
		print('first')
	elif lena < lenb:
		print('second')
	elif last > 0:
		print('first')
	else:
		print('second')


n = int(input())
i = 0
c1 = 0
c2 = 0
s = 0
x = 0
l1 = []
l2 = []
while i < n:
	i += 1
	x = int(input())
	s += x
	if x < 0:
		l2.append(-x)
	else:
		l1.append(x)
l1 = tuple(l1)
l2 = tuple(l2)
if s > 0:
	print('first')
if s < 0:
	print('second')
if s == 0:
	if l1 > l2:
		print('first')
	if l1 < l2:
		print('second')
	if l1 == l2:
		if x > 0:
			print('first')
		else:
			print('second')


n = int(input())
a = []
b = []
for i in range(n):
	k = int(input())
	if k > 0:
		a.append(k)
	else:
		b.append(-k)
if sum(a) == sum(b):
	if a > b:
		print('first')
	elif a < b:
		print('second')
	elif k > 0:
		print('first')
	else:
		print('second')
elif sum(a) > sum(b):
	print('first')
else:
	print('second')


from sys import stdin, stdout
nmbr = lambda : int(stdin.readline())
lst = lambda : list(map(int, stdin.readline().split()))
for _ in range(1):
	a = []
	b = []
	x = nmbr()
	last = 0
	for i in range(x):
		n = nmbr()
		if n > 0:
			if i == x - 1:
				last = 1
			a += [n]
		else:
			b += [-n]
	sa = sum(a)
	sb = sum(b)
	if sa > sb:
		print('first')
	elif sb > sa:
		print('second')
	else:
		na = len(a)
		nb = len(b)
		p = p1 = f = s = 0
		while p < na and p1 < nb:
			if a[p] > b[p1]:
				f = 1
				break
			elif a[p] < b[p1]:
				s = 1
				break
			p += 1
			p1 += 1
		if f == s == 0:
			print('first' if last else 'second')
		elif f:
			print('first')
		else:
			print('second')


n = int(input())
s1 = 0
s2 = 0
a1 = []
a2 = []
for i in range(n):
	a = int(input())
	if a > 0:
		s1 += a
		a1.append(a)
	else:
		s2 += -1 * a
		a2.append(-1 * a)
	if i == n - 1:
		if a > 0:
			k = 1
		else:
			k = 2
if s1 > s2:
	print('first')
	exit()
elif s1 < s2:
	print('second')
	exit()
for i in range(len(a1)):
	if a1[i] > a2[i]:
		print('first')
		exit()
	elif a1[i] < a2[i]:
		print('second')
		exit()
if len(a1) > len(a2):
	print('first')
	exit()
elif len(a1) < len(a2):
	print('second')
	exit()
if k == 2:
	print('second')
else:
	print('first')


def main():
	n = int(input().strip())
	(aa, bb) = ([], [])
	for _ in range(n):
		a = int(input().strip())
		if a > 0:
			aa.append(a)
		else:
			bb.append(-a)
	res = sum(aa) - sum(bb)
	if res:
		res = res < 0
	else:
		res = a < 0
		aa.append(0)
		bb.append(0)
		for (a, b) in zip(aa, bb):
			if a != b:
				res = a < b
				break
	print(('first', 'second')[res])
main()


n = int(input())
(l, d) = ([], [])
for i in range(n):
	x = int(input())
	ka = x
	if x > 0:
		l.append(x)
	else:
		d.append(abs(x))
x = sum(l)
y = sum(d)
if x > y:
	print('first')
elif y > x:
	print('second')
elif l > d:
	print('first')
elif d > l:
	print('second')
elif ka > 0:
	print('first')
else:
	print('second')


import sys
import math
n = int(sys.stdin.readline())
firstsum = 0
secondsum = 0
firstarr = []
lenfirst = 0
secondarr = []
lensecond = 0
last = 0
for i in range(n):
	v = int(sys.stdin.readline())
	if v > 0:
		firstsum += v
		firstarr.append(v)
		lenfirst += 1
		last = 1
	else:
		v = int(math.fabs(v))
		secondsum += v
		secondarr.append(v)
		lensecond += 1
		last = 0
if firstsum > secondsum:
	print('first')
elif secondsum > firstsum:
	print('second')
else:
	for i in range(min(lenfirst, lensecond)):
		if firstarr[i] > secondarr[i]:
			print('first')
			exit()
		elif secondarr[i] > firstarr[i]:
			print('second')
			exit()
	if last == 1:
		print('first')
	else:
		print('second')


__author__ = 'zhan'
n = int(input())
first = []
second = []
total1 = 0
total2 = 0
last = 0

def compare_seq():
	f = 0
	s = 0
	while f < len(first) and s < len(second):
		if first[f] > second[s]:
			return 1
		if first[f] < second[s]:
			return 2
		f += 1
		s += 1
	if len(first) == len(second):
		return 0
	if len(first) < len(second):
		return 2
	return 1

def winner():
	if total1 != total2:
		return 'first' if total1 > total2 else 'second'
	if compare_seq() == 1:
		return 'first'
	if compare_seq() == 2:
		return 'second'
	return 'first' if last > 0 else 'second'
for i in range(n):
	score = int(input())
	if i == n - 1:
		last = score
	if score > 0:
		first.append(score)
		total1 += score
	else:
		second.append(-score)
		total2 += -score
print(winner())


n = int(input())
(i1, i2) = (0, 0)
l1 = [0] * n
l2 = [0] * n
for i in range(n):
	a = int(input())
	if a < 0:
		l2[i2] = abs(a)
		i2 = i2 + 1
	else:
		l1[i1] = a
		i1 = i1 + 1
s1 = sum(l1)
s2 = sum(l2)
if s1 > s2:
	print('first')
elif s1 < s2:
	print('second')
else:
	c = -1
	for i in range(n):
		if l1[i] == l2[i]:
			pass
		elif l1[i] > l2[i]:
			c = 1
			print('first')
			break
		else:
			c = 1
			print('second')
			break
	if c == -1:
		if a > 0:
			print('first')
		else:
			print('second')


n = int(input())
(p, q) = (0, 0)
f = []
s = []
(first, second) = (False, False)
for i in range(n):
	x = int(input())
	if x > 0:
		p += x
		f.append(x)
	else:
		q += -x
		s.append(-x)
	if i == n - 1:
		if x > 0:
			first = True
		else:
			second = True
if q > p:
	print('second')
elif p > q:
	print('first')
elif f < s:
	print('second')
elif f > s:
	print('first')
elif first:
	print('first')
else:
	print('second')


n = int(input())
a = []
b = []
asum = 0
bsum = 0
last = 0
for _ in range(n):
	x = int(input())
	if x > 0:
		a.append(x)
		asum += x
		last = 'first'
		continue
	b.append(-x)
	bsum -= x
	last = 'second'
if asum != bsum:
	if asum > bsum:
		print('first')
	else:
		print('second')
else:
	for i in range(min(len(a), len(b))):
		if a[i] > b[i]:
			print('first')
			break
		elif a[i] < b[i]:
			print('second')
			break
	else:
		if len(a) == len(b):
			print(last)
		elif len(a) > len(b):
			print('first')
		else:
			print('second')


n = int(input())
last = ''
first = list()
second = list()
for i in range(0, n):
	num = int(input())
	if num > 0:
		first.append(num)
		last = 'first'
	else:
		second.append(abs(num))
		last = 'second'
if sum(first) > sum(second):
	print('first')
elif sum(first) < sum(second):
	print('second')
else:
	for i in range(0, min(len(first), len(second))):
		if first[i] > second[i]:
			print('first')
			exit(0)
		elif first[i] < second[i]:
			print('second')
			exit(0)
	if len(first) > len(second):
		print('first')
	elif len(first) < len(second):
		print('second')
	else:
		print(last)


n = int(input())
last = 1
s1 = s2 = 0
num1 = []
num2 = []
win = -1
for i in range(n):
	num = int(input())
	if num < 0:
		last = 'second'
		s2 -= num
		num2.append(-num)
	else:
		last = 'first'
		s1 += num
		num1.append(num)
if s1 == s2:
	ans = ''
	for i in range(min(len(num1), len(num2))):
		if num1[i] > num2[i]:
			ans = 'first'
			break
		elif num1[i] < num2[i]:
			ans = 'second'
			break
	print(ans if ans != '' else last)
else:
	print('first' if s1 > s2 else 'second')


first = []
second = []
last = 0
for i in range(int(input())):
	k = int(input())
	if k > 0:
		first.append(k)
	elif k < 0:
		second.append(-k)
	last = k
sumfirst = sum(first)
sumsecond = sum(second)
if sumfirst != sumsecond:
	if sumfirst > sumsecond:
		print('first')
	else:
		print('second')
else:
	i = 0
	j = 0
	fi = len(first)
	se = len(second)
	while i < fi and j < se and (first[i] == second[j]):
		i += 1
		j += 1
	if i != fi and j != se:
		if first[i] > second[j]:
			print('first')
		if first[i] < second[j]:
			print('second')
	elif fi != se:
		if fi > se:
			print('first')
		else:
			print('second')
	elif last < 0:
		print('second')
	else:
		print('first')


n2 = int(input())
n = []
p = []
t = 0
for i in range(n2):
	n1 = int(input())
	if n1 > 0:
		p.append(n1)
		t = 0
	else:
		n.append(-n1)
		t = 1
if sum(n) != sum(p):
	if sum(n) > sum(p):
		print('second')
	else:
		print('first')
elif n != p:
	if n > p:
		print('second')
	else:
		print('first')
else:
	print(['first', 'second'][t])


ans1 = 0
ans2 = 0
l1 = []
l2 = []
for _ in range(int(input())):
	n = int(input())
	if n > 0:
		ans1 += n
		l1.append(n)
	else:
		ans2 += abs(n)
		l2.append(-n)
if ans1 > ans2 or (ans1 == ans2 and l1 > l2) or (l1 == l2 and n > 0):
	print('first')
else:
	print('second')


def check_sum():
	(s1, s2) = (sum(first), sum(second))
	if s1 > s2:
		return 'first'
	elif s1 < s2:
		return 'second'
	else:
		return 0

def chech_lexio():
	(l1, l2) = (len(first), len(second))
	for i in range(min(l1, l2)):
		if first[i] > second[i]:
			return 'first'
		elif first[i] < second[i]:
			return 'second'
	if l1 > l2:
		return 'first'
	elif l1 < l2:
		return 'second'
	else:
		return 0
(n, first, second, last) = (int(input()), [], [], 'first')
for i in range(n):
	x = int(input())
	if x > 0:
		first.append(x)
	else:
		second.append(abs(x))
	if i == n - 1 and x < 0:
		last = 'second'
ans = check_sum()
if ans:
	print(ans)
else:
	ans = chech_lexio()
	if ans:
		print(ans)
	else:
		print(last)


n = int(input())
pos_arr = []
neg_arr = []
pos_sum = 0
neg_sum = 0
for i in range(n):
	x = int(input())
	if x > 0:
		pos_sum += x
		pos_arr.append(x)
	else:
		neg_sum += -x
		neg_arr.append(-x)
	if i == n - 1:
		last = x
if pos_sum > neg_sum:
	print('first')
elif pos_sum < neg_sum:
	print('second')
elif pos_arr > neg_arr:
	print('first')
elif pos_arr < neg_arr:
	print('second')
elif last < 0:
	print('second')
else:
	print('first')


n = int(input())
last = 'first'
a = []
b = []
suma = 0
sumb = 0
for i in range(n):
	x = int(input())
	if x > 0:
		last = 'first'
		a.append(x)
		suma += x
	else:
		last = 'second'
		b.append(-x)
		sumb += -x
if suma > sumb:
	print('first')
	quit()
if suma < sumb:
	print('second')
	quit()
for i in range(min(len(a), len(b))):
	if a[i] > b[i]:
		print('first')
		quit()
	elif a[i] < b[i]:
		print('second')
		quit()
if len(a) > len(b):
	print('first')
elif len(a) < len(b):
	print('second')
else:
	print(last)


def comp(x, y):
	nx = len(x)
	ny = len(y)
	xptr = 0
	yptr = 0
	if x == y:
		return 'tie'
	while xptr < nx and yptr < ny:
		if x[xptr] == y[yptr]:
			xptr += 1
			yptr += 1
		elif x[xptr] > y[yptr]:
			return 'first'
		else:
			return 'second'
	if xptr == nx and yptr < ny:
		return 'second'
	return 'first'
x = []
y = []
n = int(input())
px = 0
py = 0
lx = 0
ly = 0
for index in range(n):
	i = int(input())
	if i > 0:
		x += [i]
		px += i
		lx = index
	else:
		y += [abs(i)]
		py += abs(i)
		ly = index
if px > py:
	print('first')
elif py > px:
	print('second')
else:
	s = comp(x, y)
	if s != 'tie':
		print(s)
	elif lx > ly:
		print('first')
	else:
		print('second')


n = int(input())
score1 = 0
score2 = 0
str1 = list()
str2 = list()
last = 0
for i in range(n):
	x = int(input())
	if x > 0:
		score1 += x
		str1.append(x)
		last = 1
	else:
		x = abs(x)
		score2 += x
		str2.append(x)
		last = 2
if score1 > score2:
	print('first')
elif score2 > score1:
	print('second')
else:
	f = 0
	for i in range(min(len(str1), len(str2))):
		if str1[i] > str2[i]:
			print('first')
			f = 1
			break
		elif str1[i] < str2[i]:
			print('second')
			f = 1
			break
	if f == 0:
		if len(str1) > len(str2) or (len(str1) == len(str2) and last == 1):
			print('first')
		else:
			print('second')


import sys
input = lambda : sys.stdin.readline()
int_arr = lambda : list(map(int, input().split()))
str_arr = lambda : list(map(str, input().split()))
get_str = lambda : map(str, input().split())
get_int = lambda : map(int, input().split())
get_flo = lambda : map(float, input().split())

def solve(arr):
	(f, s) = ([], [])
	for i in range(len(arr)):
		if arr[i] >= 0:
			f.append(arr[i])
		else:
			s.append(abs(arr[i]))
	if sum(f) == sum(s):
		for i in range(min(len(s), len(f))):
			if f[i] != s[i]:
				if f[i] > s[i]:
					print('first')
					return
				else:
					print('second')
					return
		else:
			if arr[-1] >= 0:
				print('first')
			else:
				print('second')
	elif sum(f) > sum(s):
		print('first')
	else:
		print('second')
arr = []
for _ in range(int(input())):
	arr.append(int(input()))
solve(arr)


n = int(input())
a = []
b = []
x = 0
for i in range(n):
	q = int(input())
	if q > 0:
		x = 1
		a.append(q)
	else:
		x = -1
		b.append(-q)
if sum(a) != sum(b):
	print('first' if sum(a) > sum(b) else 'second')
elif a != b:
	print('first' if a > b else 'second')
else:
	print('first' if x > 0 else 'second')


def lex(a, b):
	for i in range(min(len(a), len(b))):
		if a[i] > b[i]:
			return True
		elif a[i] < b[i]:
			return False
	if len(a) > len(b):
		return True
	return False
n = int(input())
w1 = []
w2 = []
last = True
for i in range(n):
	x = int(input())
	if x < 0:
		last = False
		w2.append(-x)
	else:
		last = True
		w1.append(x)
if sum(w1) > sum(w2):
	print('first')
elif sum(w1) == sum(w2):
	if lex(w1, w2):
		print('first')
	elif lex(w2, w1):
		print('second')
	elif last:
		print('first')
	else:
		print('second')
else:
	print('second')


n = int(input())
(f, s, pts) = ([], [], 0)
for i in range(n):
	pts = int(input())
	if pts > 0:
		f.append(pts)
	else:
		s.append(-pts)
(fs, ss) = (sum(f), sum(s))
(fl, sl) = (len(f), len(s))
if fs != ss:
	print('first' if fs > ss else 'second')
else:
	sm1won = False
	for i in range(min(fl, sl)):
		if f[i] != s[i]:
			sm1won = True
			print('first' if f[i] > s[i] else 'second')
			break
	if not sm1won:
		if fl != sl:
			print('first' if fl > sl else 'second')
		else:
			print('first' if pts > 0 else 'second')


s1 = ''
s2 = ''
cnt1 = 0
cnt2 = 0
last = None
check = None
(a, b) = ([], [])
n = int(input())
for i in range(n):
	x = int(input())
	if x > 0:
		a.append(x)
		cnt1 += x
		last = 0
	else:
		x = abs(x)
		b.append(x)
		cnt2 += x
		last = 1
if cnt1 > cnt2:
	print('first')
elif cnt1 < cnt2:
	print('second')
elif a > b:
	print('first')
elif a < b:
	print('second')
elif last == 0:
	print('first')
else:
	print('second')


f = []
s = []
l = -1
for _ in range(int(input())):
	x = int(input())
	if x < 0:
		s.append(-x)
		l = 1
	else:
		f.append(x)
		l = 0
if sum(f) > sum(s):
	print('first')
elif sum(f) < sum(s):
	print('second')
elif f == s:
	print('fsiercsotn d'[l::2])
else:
	for i in range(min(len(f), len(s))):
		if f[i] < s[i]:
			print('second')
			break
		elif f[i] > s[i]:
			print('first')
			break


n = int(input())
fr = []
sn = []
s = f = a = 0
for i in range(n):
	a = int(input())
	if a > 0:
		f += a
		fr.append([a])
	else:
		s += abs(a)
		sn.append([abs(a)])
if f > s:
	print('first')
elif f < s:
	print('second')
else:
	c = 0
	m = min(len(fr), len(sn))
	for i in range(m):
		if fr[i] > sn[i]:
			print('first')
			c = 1
			break
		elif fr[i] < sn[i]:
			print('second')
			c = 1
			break
	if c == 0:
		if a < 0:
			print('second')
		else:
			print('first')


p1 = []
p2 = []
l = 0
for _ in range(int(input())):
	a = int(input())
	if a > 0:
		p1.append(a)
	else:
		p2.append(-a)
	l = a
if sum(p1) > sum(p2):
	print('first')
elif sum(p1) < sum(p2):
	print('second')
elif p1 == p2:
	if l > 0:
		print('first')
	else:
		print('second')
else:
	i = 0
	j = 0
	while i < len(p1) and j < len(p2):
		if p1[i] > p2[j]:
			print('first')
			break
		elif p2[j] > p1[i]:
			print('second')
			break
		i += 1
		j += 1


a = []
b = []
sa = 0
sb = 0
n = int(input())
for _ in range(n):
	s = input()
	if s[0] == '-':
		b.append(int(s[1:]))
		sb += int(s[1:])
	else:
		a.append(int(s))
		sa += int(s)
last = s
if sa > sb:
	print('first')
elif sa < sb:
	print('second')
elif a > b:
	print('first')
elif a < b:
	print('second')
elif s[0] == '-':
	print('second')
else:
	print('first')


def main():
	(n,) = read()
	a = []
	b = []
	last = 0
	for i in range(n):
		(x,) = read()
		if x < 0:
			b.append(-x)
			last = 1
		else:
			a.append(x)
			last = 0
	if sum(a) > sum(b):
		print('first')
	elif sum(b) > sum(a):
		print('second')
	elif a > b:
		print('first')
	elif b > a:
		print('second')
	else:
		print('second' if last else 'first')

def read(mode=2):
	inputs = input().strip()
	if mode == 0:
		return inputs
	if mode == 1:
		return inputs.split()
	if mode == 2:
		return list(map(int, inputs.split()))

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='')
write(main())


num = int(input().split('\n')[0])
first = []
second = []
last_move = 0
for i in range(num):
	next = int(input().split('\n')[0])
	if next > 0:
		first.append(next)
		if i == num - 1:
			last_move = 'first'
	else:
		second.append(-next)
		if i == num - 1:
			last_move = 'second'
if sum(first) > sum(second):
	print('first')
elif sum(second) > sum(first):
	print('second')
elif first > second:
	print('first')
elif second > first:
	print('second')
else:
	print(last_move)


input = __import__('sys').stdin.readline
pos = []
neg = []
fi = se = aa = 0
for _ in range(int(input())):
	n = int(input())
	aa = n
	if n > 0:
		fi += n
		pos.append(n)
	else:
		se += abs(n)
		neg.append(abs(n))
if fi > se:
	print('first')
elif se > fi:
	print('second')
else:
	m = min(len(pos), len(neg))
	for i in range(m):
		if pos[i] > neg[i]:
			print('first')
			exit()
		elif pos[i] < neg[i]:
			print('second')
			exit()
	if aa < 0:
		print('second')
	else:
		print('first')


import sys
import bisect
import heapq
from math import *
from collections import defaultdict as dd
from collections import deque
from collections import Counter as c
from itertools import combinations as comb
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(var)

def l():
	return list(map(int, data().split()))

def sl():
	return list(map(str, data().split()))

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [[val for i in range(n)] for j in range(m)]
n = int(data())
(first, second) = ([], [])
(f, s) = (0, 0)
for i in range(n):
	a = int(data())
	if a < 0:
		second.append(abs(a))
		s += abs(a)
		continue
	first.append(a)
	f += a
if s > f:
	out('second')
	exit()
if f > s:
	out('first')
	exit()
if first == second:
	if a < 0:
		out('second')
		exit()
	out('first')
	exit()
for i in range(min(len(first), len(second))):
	if first[i] > second[i]:
		out('first')
		exit()
	if first[i] < second[i]:
		out('second')
		exit()


n = int(input())
first = []
second = []
for i in range(n):
	a = int(input())
	if a > 0:
		first.append(a)
		flag = True
	else:
		second.append(-a)
		flag = False
sum_first = sum(first)
sum_second = sum(second)
if sum_first > sum_second:
	print('first')
elif sum_first < sum_second:
	print('second')
elif first > second:
	print('first')
elif first < second:
	print('second')
elif flag:
	print('first')
else:
	print('second')


n = int(input())
f = []
s = []
p = 0
l = 0
while n:
	n -= 1
	a = int(input())
	p += a
	if a < 0:
		s.append(-a)
		l = 2
	else:
		f.append(a)
		l = 1
if p > 0:
	print('first')
elif p < 0:
	print('second')
elif f > s:
	print('first')
elif s > f:
	print('second')
elif l == 1:
	print('first')
else:
	print('second')


t = int(input())
s = [None] * t
i = 0
while i < t:
	s[i] = int(input())
	i += 1
x = sum(s)
if x > 0:
	print('first')
elif x < 0:
	print('second')
else:
	a = [i for i in s if i > 0]
	b = [-i for i in s if i < 0]
	if a > b:
		print('first')
	elif b > a:
		print('second')
	elif s[-1] > 0:
		print('first')
	else:
		print('second')


def check_lexi(a, b):
	for i in range(len(a)):
		t = abs(a[i]) - abs(b[i])
		if t < 0:
			return -1
		if t > 0:
			return 1
	if len(a) - len(b) != 0:
		return len(a) - len(b)
	return 0

def solve(arr):
	score = 0
	(a, b) = ([], [])
	for point in arr:
		score += point
		if point > 0:
			a.append(point)
		else:
			b.append(point)
	if score != 0:
		return 1 if score > 0 else -1
	c = check_lexi(a, b)
	if c != 0:
		return c
	return 1 if arr[-1] > 0 else -1
n = int(input())
res = solve([int(input()) for _ in range(n)])
print('first' if res > 0 else 'second')


n = int(input())
fir = [0] * n
sec = [0] * n
i = 0
i1 = 0
summ = 0
summ1 = 0
ai = 0
en = 0
for num in range(n):
	ai = int(input())
	if ai > 0:
		fir[i] = ai
		summ += ai
		i += 1
	else:
		sec[i1] = -ai
		summ1 += -ai
		i1 += 1
if summ1 > summ:
	print('second')
elif summ > summ1:
	print('first')
elif summ == summ1:
	for num in range(n):
		if fir[num] > sec[num]:
			print('first')
			en = 1
			break
		elif fir[num] < sec[num]:
			print('second')
			en = 1
			break
	if en == 0:
		if ai > 0:
			print('first')
		else:
			print('second')


n = int(input())
netSum = 0
lastChop = 'first'
first = list()
second = list()
for i in range(n):
	temp = int(input())
	if temp > 0:
		netSum += temp
		first.append(temp)
	else:
		netSum += temp
		if i == n - 1:
			lastChop = 'second'
		temp = temp * -1
		second.append(temp)
if netSum < 0:
	print('second')
elif netSum > 0:
	print('first')
else:
	i = 0
	j = 0
	while i < len(first) and j < len(second) and (first[i] == second[j]):
		i += 1
		j += 1
	if i == len(first) and j == len(second):
		print(lastChop)
	elif i < len(first) and j == len(second):
		print('first')
	elif i == len(first) and j < len(second):
		print('second')
	elif first[i] < second[j]:
		print('second')
	else:
		print('first')


x = int(input())
(arr, brr, s, f, l) = ([], [], 0, 0, 0)
for i in range(x):
	y = int(input())
	l = y
	if y < 0:
		s += abs(y)
		brr.append(abs(y))
	else:
		f += y
		arr.append(y)
if f > s:
	print('first')
elif s > f:
	print('second')
else:
	for i in range(0, min(len(arr), len(brr))):
		if arr[i] > brr[i]:
			print('first')
			break
		elif brr[i] > arr[i]:
			print('second')
			break
	else:
		if l > 0:
			print('first')
		else:
			print('second')


n = int(input())
a1 = []
a2 = []
last = True
for i in range(n):
	v = int(input())
	if v > 0:
		a1.append(v)
	else:
		a2.append(-v)
	if i == n - 1:
		last = v > 0
s1 = sum(a1)
s2 = sum(a2)
if s1 > s2 or (s1 == s2 and a1 > a2) or (s1 == s2 and a1 == a2 and last):
	print('first')
else:
	print('second')


N = int(input())
first = []
second = []
Sum_first = 0
Sum_second = 0
last = ''
for _ in range(N):
	x = int(input())
	if x > 0:
		Sum_first += x
		first.append(x)
		last = 'first'
	else:
		Sum_second += -x
		second.append(-x)
		last = 'second'
if Sum_first > Sum_second:
	print('first')
elif Sum_first < Sum_second:
	print('second')
elif first > second:
	print('first')
elif first < second:
	print('second')
else:
	print(last)


import sys
import string
import math
from collections import defaultdict
from functools import lru_cache
from collections import Counter
from fractions import Fraction

def mi(s):
	return map(int, s.strip().split())

def lmi(s):
	return list(mi(s))

def tmi(s):
	return tuple(mi(s))

def mf(f, s):
	return map(f, s)

def lmf(f, s):
	return list(mf(f, s))

def js(lst):
	return ' '.join((str(d) for d in lst))

def line():
	return sys.stdin.readline().strip()

def linesp():
	return line().split()

def iline():
	return int(line())

def mat(n):
	matr = []
	for _ in range(n):
		matr.append(linesp())
	return matr

def matns(n):
	mat = []
	for _ in range(n):
		mat.append([c for c in line()])
	return mat

def mati(n):
	mat = []
	for _ in range(n):
		mat.append(lmi(line()))
	return mat

def pmat(mat):
	for row in mat:
		print(js(row))

def dist(x, y):
	return ((x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2) ** 0.5

def fast_exp(x, n):
	if n == 0:
		return 1
	elif n % 2 == 1:
		return x * fast_exp(x, (n - 1) // 2) ** 2
	else:
		return fast_exp(x, n // 2) ** 2

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

def main(first, second, last_positive):
	if sum(first) > sum(second):
		print('first')
		return
	elif sum(first) < sum(second):
		print('second')
		return
	elif first > second:
		print('first')
	elif first < second:
		print('second')
	elif last_positive:
		print('first')
	else:
		print('second')
first = []
second = []
n = iline()
last_positive = True
for _ in range(n):
	k = iline()
	if k > 0:
		first.append(k)
		last_positive = True
	else:
		second.append(-k)
		last_positive = False
main(first, second, last_positive)


def check(f, s):
	l = min(len(f), len(s))
	for i in range(l):
		if f[i] > s[i]:
			return 1
		elif f[i] < s[i]:
			return 2
	if len(f) > len(s):
		return 1
	elif len(f) < len(s):
		return 2
	else:
		return 0
n = int(input())
f = s = 0
fs = []
ss = []
last = ''
for i in range(n):
	t = int(input())
	if t > 0:
		f += t
		fs.append(t)
		last = 'first'
	else:
		t = abs(t)
		s += t
		ss.append(t)
		last = 'second'
c = check(fs, ss)
if f > s:
	print('first')
elif s > f:
	print('second')
elif c == 1:
	print('first')
elif c == 2:
	print('second')
else:
	print(last)


z = int(input())
lst1 = []
lst2 = []
for i in range(z):
	x = int(input())
	lst1.append(x) if x > 0 else lst2.append(-x)
s1 = sum(lst1)
s2 = sum(lst2)
if s1 != s2:
	print(['second', 'first'][s1 > s2])
elif lst1 == lst2:
	print(['second', 'first'][x > 0])
else:
	for i in range(z):
		if lst1[i] != lst2[i]:
			print(['second', 'first'][lst1[i] > lst2[i]])
			break


a = []
b = []
n = int(input())
i = 0
c = -1
while i < n:
	p = int(input())
	if p > 0:
		a.append(p)
		if i == n - 1:
			c = 0
	elif p < 0:
		b.append(-1 * p)
		if i == n - 1:
			c = 1
	i += 1
if sum(a) > sum(b):
	print('first')
elif sum(b) > sum(a):
	print('second')
elif a < b:
	print('second')
elif b < a:
	print('first')
elif c == 0:
	print('first')
elif c == 1:
	print('second')


n = int(input())
f = list((int(input()) for i in range(n)))
s = list(map(lambda x: -x, f))
last_tec = f[-1] > 0
if sum(f) > 0:
	print('first')
elif sum(f) < 0:
	print('second')
else:
	f = [a for a in f if a > 0]
	s = [a for a in s if a > 0]
	print('first' if (last_tec if f == s else f > s) else 'second')


n = int(input())
a = []
b = []
last = -1
for _ in range(n):
	x = int(input())
	if x > 0:
		last = 1
		a.append(x)
	elif x < 0:
		last = 2
		b.append(-x)
if sum(a) > sum(b):
	print('first')
elif sum(a) < sum(b):
	print('second')
else:
	for i in range(min(len(a), len(b))):
		if a[i] > b[i]:
			print('first')
			break
		elif a[i] < b[i]:
			print('second')
			break
	else:
		if len(a) > len(b):
			print('first')
		elif len(a) < len(b):
			print('second')
		elif last == 1:
			print('first')
		else:
			print('second')


arr = []
brr = []
for _ in range(int(input())):
	n = int(input())
	if n > 0:
		arr.append(n)
	else:
		brr.append(-1 * n)
if sum(arr) > sum(brr):
	print('first')
elif sum(arr) < sum(brr):
	print('second')
elif arr > brr:
	print('first')
elif arr < brr:
	print('second')
elif n > 0:
	print('first')
else:
	print('second')


from math import *
n = int(input())
sum = 0
f = []
s = []
last = 0
n1 = 0
n2 = 0
for i in range(n):
	x = int(input())
	sum += x
	if x > 0:
		f.append(str(x))
		n1 += 1
	else:
		s.append(str(-1 * x))
		n2 += 1
	last = x
if sum > 0:
	print('first')
elif sum < 0:
	print('second')
else:
	c = 0
	for i in range(min(n1, n2)):
		x = int(f[i])
		y = int(s[i])
		if x > y:
			c = 1
			break
		elif x < y:
			c = 2
			break
	if c == 1:
		print('first')
	elif c == 2:
		print('second')
	elif n1 == n2:
		if last > 0:
			print('first')
		else:
			print('second')
	elif n1 > n2:
		print('first')
	else:
		print('second')


import sys
from itertools import chain

def solution(first, second, last):
	(_sum1, _sum2) = (sum(first), sum(second))
	if _sum1 != _sum2:
		if _sum1 > _sum2:
			return 'first'
		return 'second'
	for (f, s) in zip(first, second):
		if f != s:
			if f > s:
				return 'first'
			elif f < s:
				return 'second'
	return 'first' if last > 0 else 'second'
_ = input()
(first, second) = ([], [])
last = None
for i in map(int, sys.stdin.readlines()):
	if i > 0:
		first.append(i)
	else:
		second.append(abs(i))
last = i
print(solution(first, second, last))


def sum_(a, b):
	c1 = 0
	for i in range(min(len(a), len(b))):
		if a[i] > b[i]:
			print('first')
			c1 = -1
			break
		elif a[i] < b[i]:
			print('second')
			c1 = -1
			break
	return c1
n = int(input())
a = []
b = []
s1 = 0
s2 = 0
for i in range(n):
	m = int(input())
	if m >= 0:
		a.append(m)
		s1 = s1 + m
	else:
		b.append(abs(m))
		s2 = s2 + abs(m)
c1 = 0
if s1 > s2:
	print('first')
elif s1 < s2:
	print('second')
else:
	c1 = 0
	if len(a) > len(b):
		for i in range(min(len(a), len(b))):
			if a[i] != b[i]:
				c1 = -1
				break
		if c1 != -1:
			print('first')
		else:
			sum_(a, b)
	elif len(a) < len(b):
		for i in range(min(len(a), len(b))):
			if a[i] != b[i]:
				c1 = -1
				break
		if c1 != -1:
			print('second')
		else:
			sum_(a, b)
	else:
		c1 = 0
		for i in range(len(a)):
			if a[i] > b[i]:
				print('first')
				c1 = -1
				break
			elif a[i] < b[i]:
				print('second')
				c1 = -1
				break
		if c1 != -1:
			if m > 0:
				print('first')
			else:
				print('second')


n = int(input())
last = None
(a, b) = ([], [])
for _ in range(n):
	score = int(input())
	last = score
	if score > 0:
		a.append(score)
	else:
		b.append(abs(score))
sumA = sum(a)
sumB = sum(b)
if sumA > sumB:
	print('first')
elif sumB > sumA:
	print('second')
elif a > b:
	print('first')
elif b > a:
	print('second')
else:
	print('first' if last > 0 else 'second')


n = int(input())
a = []
b = []
sum = 0
last = 0
for i in range(n):
	c = int(input())
	if c > 0:
		a.append(c)
	else:
		b.append(abs(c))
	if i == n - 1:
		if c > 0:
			last = 1
		else:
			last = 2
	sum += c
min = len(a)
if min < len(b):
	min = len(b)
if sum > 0:
	print('first')
	exit(0)
elif sum < 0:
	print('second')
	exit(0)
for i in range(min):
	if a[i] > b[i]:
		print('first')
		exit(0)
	if a[i] < b[i]:
		print('second')
		exit(0)
if last == 1:
	print('first')
else:
	print('second')


a = int(input())
b = []
c = []
for i in range(a):
	d = int(input())
	if d < 0:
		c.append(abs(d))
		e = 'second'
	else:
		b.append(d)
		e = 'first'
if sum(b) > sum(c):
	print('first')
elif sum(b) == sum(c):
	if b > c:
		print('first')
	elif b == c:
		print(e)
	else:
		print('second')
else:
	print('second')


n = int(input())
(first, second, move) = ([], [], 0)
for _ in range(n):
	move = int(input())
	if move > 0:
		first.append(move)
	else:
		second.append(-1 * move)
if sum(first) != sum(second):
	print('first' if sum(first) > sum(second) else 'second')
else:
	print('first' if (move > 0 if first == second else first > second) else 'second')


n = int(input())
a1 = list((int(input()) for i in range(n)))
a2 = list(map(lambda x: -x, a1))
res = a1[-1] > 0
if sum(a1) > 0:
	print('first')
elif sum(a1) < 0:
	print('second')
else:
	a1 = [i for i in a1 if i > 0]
	a2 = [i for i in a2 if i > 0]
	print('first' if (res if a1 == a2 else a1 > a2) else 'second')


n = int(input())
a = []
b = []
d = 0
for i in range(n):
	c = int(input())
	d = c
	if c > 0:
		a.append(c)
	else:
		b.append(-c)
if sum(a) == sum(b):
	k = 0
	while k < min(len(a), len(b)):
		if a[k] == b[k]:
			k += 1
			continue
		if a[k] > b[k]:
			print('first')
			break
		if a[k] < b[k]:
			print('second')
			break
	if k == min(len(a), len(b)) and len(a) == len(b):
		if d in a:
			print('first')
		else:
			print('second')
	elif k == min(len(a), len(b)) and len(a) > len(b):
		print('first')
	elif k == min(len(a), len(b)) and len(a) < len(b):
		print('second')
elif sum(a) > sum(b):
	print('first')
else:
	print('second')


n = int(input())
(t1, t2) = (0, 0)
(s1, s2) = ([], [])
f = False
for _ in range(n):
	t = int(input())
	if t < 0:
		t2 -= t
		s2.append(abs(t))
		f = False
	else:
		t1 += t
		s1.append(t)
		f = True
if t1 > t2:
	print('first')
elif t2 > t1:
	print('second')
elif s1 > s2:
	print('first')
elif s2 > s1:
	print('second')
elif f:
	print('first')
else:
	print('second')


def lex(a, b):
	if len(b) != len(a):
		minimum = min(len(a), len(b))
		flag = 0
		for iuo in range(minimum):
			if a[iuo] != b[iuo]:
				flag = 1
				if a[iuo] > b[iuo]:
					g = 1
				else:
					g = 2
				break
		if flag == 0:
			if minimum == len(a):
				return 2
			else:
				return 1
		else:
			return g
	else:
		flag = 0
		for iu in range(len(a)):
			if a[iu] > b[iu]:
				g = 1
				flag = 2
				break
			if a[iu] < b[iu]:
				g = 2
				flag = 2
				break
		if flag == 2:
			return g
		else:
			return 3
n = int(input())
lis = []
for i in range(n):
	t = int(input())
	lis.append(t)
suma = []
sumb = []
for x in lis:
	if x > 0:
		suma.append(x)
	else:
		sumb.append(abs(x))
if sum(suma) > sum(sumb):
	print('first')
elif sum(sumb) > sum(suma):
	print('second')
else:
	faltu = lex(suma, sumb)
	if faltu == 1:
		print('first')
	elif faltu == 2:
		print('second')
	elif lis[n - 1] > 0:
		print('first')
	else:
		print('second')


n = int(input())
s1 = []
s2 = []
c1 = 0
c2 = 0
for i in range(n):
	x = int(input())
	if x > 0:
		s1.append(x)
		c1 += x
	else:
		s2.append(-x)
		c2 -= x
if c1 > c2:
	print('first')
elif c2 > c1:
	print('second')
elif s1 > s2:
	print('first')
elif s2 > s1:
	print('second')
elif x > 0:
	print('first')
else:
	print('second')


n = int(input())
import queue as queue
points1 = 0
points2 = 0
lexical = True
lexical_winning = -1
q1 = queue.Queue()
q2 = queue.Queue()
winner = -1
last = -1
for i in range(n):
	num = int(input())
	last = num
	if num > 0:
		points1 += num
		if lexical:
			if q1.qsize() > 0:
				dequeued = q1.get()
				if num > dequeued:
					lexical = False
					lexical_winning = 1
				elif num < dequeued:
					lexical = False
					lexical_winning = 2
			else:
				q2.put(num)
	else:
		num = abs(num)
		points2 += num
		if lexical:
			if q2.qsize() > 0:
				dequeued = q2.get()
				if num > dequeued:
					lexical = False
					lexical_winning = 2
				elif num < dequeued:
					lexical = False
					lexical_winning = 1
			else:
				q1.put(num)
if points1 > points2:
	winner = 1
elif points2 > points1:
	winner = 2
elif lexical:
	if q1.qsize() < q2.qsize():
		winner = 1
	elif q2.qsize() < q1.qsize():
		winner = 2
	elif last > 0:
		winner = 1
	else:
		winner = 2
else:
	winner = lexical_winning
if winner == 1:
	print('first')
else:
	print('second')


import os
import sys
from io import BytesIO, IOBase
import math as M
import itertools as ITR
from collections import defaultdict as D
from collections import Counter as C
from collections import deque as Q
import threading
from functools import lru_cache, reduce
from functools import cmp_to_key as CMP
from bisect import bisect_left as BL
from bisect import bisect_right as BR
import random as R
import string
import cmath, time
enum = enumerate
start_time = time.time()
MOD = 1000000007
MA = float('inf')
MI = float('-inf')
di8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]
di4 = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def increase_stack():
	sys.setrecursionlimit(2 ** 32 // 2 - 1)
	threading.stack_size(1 << 27)
	t = threading.Thread(target=main)
	t.start()
	t.join()

def prints(a):
	print(a, end=' ')

def binary(n):
	return bin(n)[2:]

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def maxfactor(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
	if q:
		return q[-1]

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(M.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	l.sort()
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def seive(n):
	a = [1]
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p ** 2, n + 1, p):
				prime[i] = False
		p = p + 1
	for p in range(2, n + 1):
		if prime[p]:
			a.append(p)
	return a

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(M.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countchar(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def str_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def lis(arr):
	n = len(arr)
	lis = [1] * n
	maximum = 0
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
				maximum = max(maximum, lis[i])
	return maximum

def lcm(arr):
	a = arr[0]
	val = arr[0]
	for i in range(1, len(arr)):
		gcd = gcd(a, arr[i])
		a = arr[i]
		val *= arr[i]
	return val // gcd

def ncr(n, r):
	return M.factorial(n) // (M.factorial(n - r) * M.factorial(r))

def npr(n, r):
	return M.factorial(n) // M.factorial(n - r)

def inint():
	return int(inp())

def inarr():
	return list(map(int, inp().split()))

def invar():
	return map(int, inp().split())

def instr():
	s = inp()
	return list(s)

def insarr():
	return inp().split()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
inp = lambda : sys.stdin.readline().rstrip('\r\n')
TestCases = 0

def solve():
	n = inint()
	p1 = 0
	p2 = 0
	l1 = 0
	l2 = 0
	flag = 0
	aseq = []
	bseq = []
	for i in range(n):
		a = inint()
		if a > 0:
			p1 += a
			l1 += 1
			flag = 1
			aseq.append(a)
		else:
			p2 += abs(a)
			l2 += 1
			flag = 0
			bseq.append(abs(a))
	if p1 > p2:
		print('first')
		return
	if p1 == p2:
		if aseq == bseq:
			if flag:
				print('first')
				return
		if aseq > bseq:
			print('first')
			return
	print('second')

def main():
	flag = 0
	try:
		sys.stdin = open('c:/Users/Manoj Chowdary/Documents/python/CodeForces/contest-div-2/input.txt', 'r')
		sys.stdout = open('c:/Users/Manoj Chowdary/Documents/python/CodeForces/contest-div-2/output.txt', 'w')
	except:
		flag = 1
	t = 1
	if TestCases:
		t = inint()
	for _ in range(1, t + 1):
		solve()
	if not flag:
		print('Time: %.4f sec' % (time.time() - start_time))
		localtime = time.asctime(time.localtime(time.time()))
		print(localtime)
		sys.stdout.close()
main()


n = int(input())
fst = []
sec = []
last = ''
for i in range(n):
	t = int(input())
	if t > 0:
		fst.append(t)
	else:
		sec.append(abs(t))
	if i == n - 1:
		if t > 0:
			last = 'first'
		else:
			last = 'second'
if sum(fst) > sum(sec):
	print('first')
elif sum(sec) > sum(fst):
	print('second')
elif fst == sec:
	print(last)
elif fst > sec:
	print('first')
else:
	print('second')


n = int(input())
l1 = []
l2 = []
l = 0
for i in range(n):
	x = int(input())
	l = x
	if x > 0:
		l1.append(x)
	else:
		l2.append(abs(x))
if sum(l1) > sum(l2):
	print('first')
	exit(0)
if sum(l2) > sum(l1):
	print('second')
	exit(0)
if l1 > l2:
	print('first')
	exit(0)
if l2 > l1:
	print('second')
	exit(0)
if l > 0:
	print('first')
	exit(0)
if l < 0:
	print('second')
	exit(0)


n = int(input())
lf = []
ls = []
last = 'f'
for _ in range(n):
	score = int(input())
	if score > 0:
		lf.append(score)
		last = 'f'
	else:
		ls.append(-score)
		last = 's'
lfsum = sum(lf)
lssum = sum(ls)
if lfsum > lssum:
	print('first')
elif lfsum < lssum:
	print('second')
elif lf == ls:
	if last == 'f':
		print('first')
	else:
		print('second')
elif lf > ls:
	print('first')
else:
	print('second')


from collections import deque
n = int(input())
r1 = deque()
r2 = deque()
y = deque()
e = ''
for i in range(n):
	x = int(input())
	y.append(x)
	if x > 0:
		r1.append(x)
		e = 'first'
	else:
		r2.append(abs(x))
		e = 'second'
if sum(r1) > sum(r2):
	print('first')
elif sum(r2) > sum(r1):
	print('second')
elif r1 > r2:
	print('first')
elif r2 > r1:
	print('second')
elif r1 == r2:
	print(e)


def input_int():
	return list(map(int, input().split()))
[n] = input_int()
f = []
s = []
fs = ss = 0
last = ''
for i in range(0, n):
	[x] = input_int()
	if x > 0:
		f.append(x)
		fs += x
	else:
		s.append(abs(x))
		ss += abs(x)
	if i == n - 1:
		last = 'first' if x > 0 else 'second'
if fs != ss:
	print('first' if fs > ss else 'second')
else:
	lf = len(f)
	ls = len(s)
	y = min(lf, ls) - 1
	b = False
	i = 0
	while not b and i <= y:
		if f[i] != s[i]:
			b = True
		else:
			i += 1
	if b:
		print('first' if f[i] > s[i] else 'second')
	elif lf != ls:
		print('first' if lf > ls else 'second')
	else:
		print(last)


n = int(input())
c1 = 0
c2 = 0
c3 = []
c4 = []
for i in range(n):
	c = int(input())
	if c > 0:
		c1 += c
		c3 += [c]
	else:
		c2 += abs(c)
		c4 += [abs(c)]
x = c
if c1 > c2:
	print('first')
elif c2 > c1:
	print('second')
elif c3 == c4:
	if x > 0:
		print('first')
	else:
		print('second')
else:
	for i in range(min(len(c3), len(c4))):
		if c3[i] > c4[i]:
			print('first')
			break
		elif c3[i] < c4[i]:
			print('second')
			break


n = int(input())
(a, b) = ([], [])
for i in range(n):
	x = int(input())
	if x > 0:
		a.append(x)
	else:
		b.append(-x)
	last = 1 if x > 0 else -1
(sa, sb) = (sum(a), sum(b))
if sa != sb:
	flag = sa > sb
elif a != b:
	flag = a > b
else:
	flag = last == 1
print('first' if flag else 'second')


n = int(input())
last = 0
acts = [[], []]
for i in range(n):
	curr = int(input())
	if curr > 0:
		acts[0].append(curr)
		last = 1
	else:
		acts[1].append(-curr)
		last = 2
(s1, s2) = map(sum, acts)
if s1 > s2:
	won = 1
elif s1 < s2:
	won = 2
elif acts[0] > acts[1]:
	won = 1
elif acts[0] < acts[1]:
	won = 2
else:
	won = last
if won == 1:
	print('first')
else:
	print('second')


_technique = int(input())
who_is_last = 1
(first, second) = ([], [])
for counter in range(0, _technique, 1):
	_input = int(input())
	if _input > 0:
		who_is_last = 1
		first.append(_input)
	else:
		who_is_last = 2
		second.append(_input)
sum_first = sum(first)
sum_second = abs(sum(second))
process = True
if sum_first == sum_second:
	if len(first) == len(second):
		for counter in range(len(first)):
			if abs(first[counter]) > abs(second[counter]):
				print('first')
				process = False
				break
			elif abs(first[counter]) < abs(second[counter]):
				print('second')
				process = False
				break
		if who_is_last == 1 and process:
			print('first')
		elif who_is_last == 2 and process:
			print('second')
	else:
		for counter in range(len(first)):
			if abs(first[counter]) > abs(second[counter]):
				print('first')
				break
			elif abs(first[counter]) < abs(second[counter]):
				print('second')
				break
elif sum_first > sum_second:
	print('first')
else:
	print('second')


a = []
b = []
n = int(input())
for _ in range(n):
	s = int(input())
	if s < 0:
		b.append(abs(s))
	else:
		a.append(abs(s))
last = s
if sum(a) != sum(b):
	print('first' if sum(a) > sum(b) else 'second')
elif a != b:
	print('first' if a > b else 'second')
else:
	print('first' if s > 0 else 'second')