This page is still under construction.

Parts of this page are still being built. What you see may change.

Kart Race

Interview

Time limit2sMemory limit512 MB

Summary
Each of n drivers reports m lap times; output the name of any driver whose total time is smallest.
Level

Easy2 of 10

Topics
Implementation, Array
Solved
No attempts yet

Problem

After another round of the Formula-A open-wheel car world championship, the drivers gathered at a cafe to discuss their results. They recalled that in their youth they had competed not in large machines but in karts, the smaller racing cars.

The friends decided to determine the winner of one of those kart races. The winner of a race was the driver whose total time to complete all laps of the track was the smallest.

Since the final results had not been preserved, each of the n participants in that race recalled and wrote down their times for each of the m laps of the track. Unfortunately, the drivers found it hard to work out the winner of that race. So they asked you to do it.

You must write a program that determines the winner of the kart race the drivers talked about.

Input

The first line of the input file contains two integers n and m (1 ≤ n, m ≤ 100). The next 2∙n lines describe how each participant drove the track. One participant's description consists of two lines. The first line contains the participant's name using only Latin letters (lowercase and uppercase). All participants' names are distinct, and lowercase and uppercase letters in names are distinguished.

The second line contains m positive integers, where each number is the time this participant took on one of the m laps of the track (each of these numbers does not exceed 1000). The length of each line does not exceed 255 characters.

Output

Output the name of the winner of the kart race to the output file. If there are several winners, output the name of any one of them.

Examples1

  1. Example 1

    Input
    5 3
    Sumaher
    2 1 1
    Barikelo
    2 1 2
    Olonso
    1 2 1
    Vasya
    1 1 1
    Fedya
    1 1 1
    
    Expected output
    Fedya