A coordinate line has *n* segments, the *i*-th segment starts at the position *l*<sub class="lower-index">*i*</sub> and ends at the position *r*<sub class="lower-index">*i*</sub>. We will denote such a segment as [*l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub>].

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* ≤ 10<sup class="upper-index">5</sup>) — the number of segments. Next *n* lines contain the descriptions of the segments. The *i*-th line contains two space-separated integers *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub> (1 ≤ *l*<sub class="lower-index">*i*</sub> ≤ *r*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) — the borders of the *i*-th segment.

It is guaranteed that no two segments coincide.
# đọc dòng đầu chứa số lượng phần tử, hay số segment
n = int(input())
list_segments = []

# duyệt qua từng dòng trong n dòng tiếp theo, với dòng thứ i đọc vào thông tin của segment i
for i in range(n):
	list_segments.append(list(map(int, input().split())))

# duyệt tìm min_l theo các left của segment
# nó cũng tương tự với lệnh for sau:
# min_l = list_segments[0][0]
# for i in range(n):
#     min_l = min(min_l, list_segments[i][0])
min_l = min(segment[0] for segment in list_segments)

# duyệt tìm max_r theo các right của segment
max_r = max(segment[1] for segment in list_segments)

# for lại để kiểm tra xem có đoạn nào trùng với [min_l, max_r] không
result = -1
for i in range(n):
	if min_l == list_segments[i][0] and max_r == list_segments[i][1]:
		result = i + 1
		break
print(result)