These days, the TV studio has started shooting another new season of Jamie Oliver's cooking show. This season, Jamie plans to introduce the delights of Croatian cuisine to the world. In the first episode, the master chef has baked a walnut roll
He has chopped the walnut roll into one meter long chops and marked them with numbers from
Write a program to determine which spectator expected to get the most walnut roll chops, and which spectator actually got the most.
Input Specification
The first line of input contains the positive integer
The second line of input contains the positive integer
Each of the following
Output Specification
The first line of output must contain the ID number of the spectator who was expecting to receive the most walnut roll chops.
The second line of output must contain the ID number of the spectator who actually received the most walnut roll chops in the end.
In both cases, if there is more than one spectator satisfying the condition, output the one with the smallest ID.
Scoring
If the first number is correct, the solution is awarded
Sample Input 1
10
3
2 4
7 8
6 9
Sample Output 1
3
1
Sample Input 2
10
3
1 3
5 7
8 9
Sample Output 2
1
1
Sample Input 3
10
5
1 1
1 2
1 3
1 4
7 8
Sample Output 3
4
5
Comments