#C3489. Taco Cooking Competition Winner

    ID: 46921 Type: Default 1000ms 256MiB

Taco Cooking Competition Winner

Taco Cooking Competition Winner

You are given a cooking competition where each contestant is identified by a unique number and the time they took to complete their dish. The rules are simple: the contestant with the least cooking time wins. In case of a tie in cooking time, the contestant with the smaller number wins.

The input provides an integer n indicating the number of contestants followed by n lines. Each line contains two space-separated integers: the contestant's number and the time taken.

Your task is to output the winning contestant's number and time using the criteria mentioned above.

Mathematically, if the cooking time for contestant i is denoted by \( t_i \) and their identifier by \( id_i \), then the winner \( (id_w, t_w) \) is determined by:

\[ (id_w, t_w) = \min_{1 \le i \le n} \{ (t_i, id_i) \} \]

inputFormat

The first line of input contains an integer n (1 ≤ n ≤ 1000), representing the number of contestants.

Each of the following n lines contains two space-separated integers: the contestant's number and the time taken (in minutes) to complete their dish.

outputFormat

Output two space-separated integers: the winner's contestant number and the time taken.

## sample
1
1 300
1 300