Problem B
Léttasta verkefnið?
Languages
en
is
Jói is taking part in Forritunarkeppni Framhaldsskólanna for the first time. His team is having quite a lot of trouble solving the problems and thus far hasn’t solved any problem. Now Jói stares at the score table with envied eyes.
But then he has an idea. Maybe his team hasn’t been trying to solve the easiest problems. He decides to make use of the score table to find out what the easiest problem is, thinking that the easiest problem is probably the one with the largest total score awarded.
But the score table is big, so Jói realizes you’d have to use a program to find the easiest problem. But he’s not good enough at programming and thus asks you for help. Won’t you help him?
Input
The first line contains a positive integer $N$ denoting the number of problems in the score table. The second line contains the positive integer $M$ denoting the number of teams in the score table. On the third line there are the names of the $N$ problems, separated by spaces. The names are unique and consist of lower case English letters. Then there are $M$ lines, on for each team. The line for a given team consists of $N$ integers from $0$ to $100$, denoting the number of points that team has gotten for that corresponding problem. That is to say, the scores are given in the same order as the names of the problems.
Output
Print a single line with the name of the problem that has awarded the most points.
Explanation of Samples
The sample contains three problems, frumtolur, lidaskipting and akureyri, along with four teams. The first team got $100$ points for frumtolur, $60$ points for lidaskipting and no points for akureyri. The second team got no points for frumtolur, $80$ points for lidaskipting and $50$ points for akureyri and so on. In total $100+0+10+0=110$ points have been awarded for frumtolur, $60+80+90+0=230$ points for lidaskipting and $0+50+10+0=60$ points for akureyri. Thus we can see that the problem lidaskipting has awarded the most points in total and is thus the answer.
Scoring
The solution will be tested on differently hard input data and the data is divided into groups as shown in the table below. The solution will then be scored according to how many groups are solved.
Group |
Points |
Constraints |
1 |
10 |
$N=1$, $M \leq 100$ |
2 |
10 |
$N=2$, $M \leq 100$ |
3 |
20 |
$N \leq 12$, $M=1$ |
4 |
20 |
$N \leq 12$, $M=2$ |
5 |
40 |
$N \leq 12$, $M \leq 500$ |
Sample Input 1 | Sample Output 1 |
---|---|
3 4 frumtolur lidaskipting akureyri 100 60 0 0 80 50 10 90 10 0 0 0 |
lidaskipting |