302551: CF493B. Vasya and Wrestling

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Vasya and Wrestling

题意翻译

#### 两个人进行摔跤表演。 第一行输入一个数字n,代表表演的次数。 接下来n个数,如果是正数则是第一位选手的得分,负数则是第二位选手的得分。 1.如果第一位选手分数大则获胜,输出"first",否则输出"second"。 2.若分数相同则按得分的字典序比大小,字典序大的获胜。 3.若字典序相同则最后一位得分的选手获胜。

题目描述

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.

输入输出格式

输入格式


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.

输出格式


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

输入输出样例

输入样例 #1

5
1
2
-3
-4
3

输出样例 #1

second

输入样例 #2

3
-1
-2
3

输出样例 #2

first

输入样例 #3

2
4
-4

输出样例 #3

second

说明

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

题意翻译

#### 两个人进行摔跤表演。 第一行输入一个数字n,代表表演的次数。 接下来n个数,如果是正数则是第一位选手的得分,负数则是第二位选手的得分。 1.如果第一位选手分数大则获胜,输出"first",否则输出"second"。 2.若分数相同则按得分的字典序比大小,字典序大的获胜。 3.若字典序相同则最后一位得分的选手获胜。

加入题单

算法标签: