Skip to main content
LIVE CONTEST: ALGOR Contest: Round #4 (Special Challenge) is live now!

~/algor $ cat problems/eng-katta-harorat-ozgarishi

Largest temperature change

Easy 1000 ms 64 MB 21%
Share

For $n$ days, the lowest temperature $l_{i}$ and the highest temperature $h_{i}$ were recorded every day. On which day did the temperature change the most (the largest $h_{i} - l_{i}$)? If there are several such days, take the first one. Print the number of the day and the change.

A temperature segment from bottom to top for every day; the longest segment is highlighted

Input

The first line contains a positive integer $n$.
Each of the next $n$ lines contains two integers: $l_{i}$ and $h_{i}$.

Output

Two integers separated by a space: the number of the day and the change.

Note

$1 \le n \le 10^{4}$
$-50 \le l_{i} \le h_{i} \le 50$

Examples

Input #1
4
-3 5
2 6
-8 4
0 12
Output #1
3 12
Input #2
2
7 7
-50 50
Output #2
2 100

Sign in to submit a solution

Signing up is free and takes a minute.