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: interview

Starter code:

Solutions:
"""
Codeforces Contest 281 Div 2 Problem B

Author  : chaotic_iak
Language: Python 3.3.4
"""

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

################################### NON-SOLUTION STUFF BELOW

def read(mode=2):
    # 0: String
    # 1: List of strings
    # 2: List of integers
    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())

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")
else:
    if a > b:
        print("first")
    elif b > a:
        print("second")
    else:
        print(last)


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
else:
    if 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())
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')
    else:
        if last>0:
            print('first')
        else:
            print('second')

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

__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')
    else:
        if last == 1:
            print('first')
        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')



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')
    else:
        if int(L[-1]) >= 0: print('first')
        else: print('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)




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')
        else:
            if last ==0 : 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"    #first player last punch

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


__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 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()

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")
     else:
         if E[-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')
else:
    ok1 = 0
    for i in range(min(len(a), len(b))):
        if a[i] > b[i]:
            ok1 = 1
            break
        elif a[i] < b[i]:
            ok1 = 2
            break
    if ok1 == 1:
        print('first')
    elif ok1 == 2:
        print('second')
    else:
        if last == 1: print('first')
        if last == 2: 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')
else:
    if a > b:
        print('first')
    elif b > a:
        print('second')
    else:
        if last == 1: print('first')
        if last == 2: print('second')


n=int(input());
a=[];
b=[];
last=0;
for i in range(n):
    x=int(input());
    if x>0: a.append(x);
    else: b.append(-x);
    last=x;
if sum(a)>sum(b): print('first');
elif sum(b)>sum(a): print('second');
else:
    if a>b: print('first');
    elif a<b: print('second');
    else:
        if last>0: print('first');
        elif last<0: 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())
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")
else:
    if a == b:
        print("first") if temp > 0 else print("second")
    else:
        print("first") if a > b else print("second")


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)


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

else:
  if ht==at:
    if x==0:
      print("first")
    else:
      print("second")
  else:   
    if ht>at:
      print("first")
    else:
      print("second")


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

else:
  if ht==at:
    if x==0:
      print("first")
    if x==1:
      print("second")
  else:   
    if ht>at:
      print("first")
    else:
      print("second")

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


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')
else:
	if first > second:
		print('first')
	elif second > first:
		print('second')
	else:
		print(last_move)