407122: GYM102697 093 Music Non Stop

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

Description

093. Music Non Stoptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Music Non Stop

You're trying to find the longest possible piece of music, so that you can play music non-stop. Given a list of songs and their durations (in MM:SS, with leading zeros), figure out which song is the longest.

Input

The first line of input contains a positive integer $$$n$$$: the number of songs. The next $$$n$$$ lines contain a string, representing the song title, a space, and the song's duration, in MM:SS format with leading zeroes. (For example, a song that was 7 minutes and 9 seconds long would be written as 07:09).

Output

Output a single string: the name of the longest song given in the input. If two songs have the same length, output the one that comes first in the input.

ExamplesInput
6
TheRobots 06:13
Spacelab 05:57
Metropolis 06:01
TheModel 03:41
NeonLights 08:53
TheManMachine 05:32
Output
NeonLights
Input
4
ReallyShortSong 01:30
ReallyLongSong 18:16
AnotherReallyLongSong 18:16
NotAsLongSong 11:01
Output
ReallyLongSong

加入题单

上一题 下一题 算法标签: