A coordinate line has n segments, the i -th segment starts at the position l i and ends at the position r i . We will denote such a segment as [l i , r i ]. You have suggested that one of the defined segments covers all others. In other words, there is such segment in the given set, which contains all other ones. Now you want to test your assumption. Find in the given set the segment which covers all other segments, and print its number. If such a segment doesn't exist, print -1. Formally we will assume that segment [a, b] covers segment [c, d], if they meet this condition a ≤ c ≤ d ≤ b .
输入描述:
The first line contains integer n (1 ≤ n ≤ 105) — the number of segments. Next n lines contain the descriptions of the segments. The i-th line contains two space-separated integers li, ri (1 ≤ li ≤ ri ≤ 109) — the borders of the i-th segment.It is guaranteed that no two segments coincide.


输出描述:
Print a single integer — the number of the segment that covers all other segments in the set. If there's no solution, print -1.The segments are numbered starting from 1 in the order in which they appear in the input.
示例1

输入

3<br />1 1<br />2 2<br />3 3<br />6<br />1 5<br />2 3<br />1 10<br />7 10<br />7 7<br />10 10<br />

输出

-1<br />3<br />
加载中...