Sprinting Frenzy


Submit solution

Points: 1
Time limit: 1.5s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++, Java, Python

It's been a long sports day, and now it's time to process the results of all of the 100m sprints.

The school can only sponsor one person to represent them at the national-level competition, and they'd like to make this decision based on the data collected today.

The criteria for who gets sponsored isn't quite as simple as whoever ran the fastest time, however.

The school instead values consistent performance, and, as such, will exclude any person who does not have at least 5 recorded times from being in contention for the spot.

In addition to this, instead of ranking them on their fastest time, we rank them from the mean of their 3 fastest times. Whoever has the lowest value from this is the person selected to represent the school.

Since there has been so much data recorded, the PE teacher asks for your help to write a program to determine who should be sponsored. Can you help them?

Input

The first line will consist of an integer n (1 \leq n \leq 100), the number of people who recorded a time during sports day.

The next 2n lines will consist of the following format:

  • A line with a name s. Names will only contain uppercase and lowercase alphabetical characters and contain between 1 and 10 characters. All names are unique.
  • A line consisting of m (1 \leq m \leq 100) recorded times for the student n, each time being separated by a space.

Output

Output the name of the person who should be nominated given our rules.

It is guaranteed that there will be a unique answer - every student will have a different mean of their fastest 3 times. It is also guaranteed that there will be at least 1 person with 5 or more recorded times.

Example

Input
4
Tom
13.92 13.00 14.1 12.977 13.15
Aaron
12.05
Jason
12.48 15.333 13.85 12 13.28
Josh
13.66 14.2
Output
Jason

Aaron and Josh are out of contention, since they did not have at least 5 recorded times.

Tom has a mean 3 fastest times of \frac{12.977 + 13.00 + 13.15}{3} \approx 13.042.

Jason has a mean 3 fastest times of \frac{12 + 12.48 + 13.28}{3} \approx 12.587.

As such, Jason will be chosen to represent the school.


Comments

There are no comments at the moment.