You are given a sequence a1, a2, ..., an of one-dimensional segments numbered 1 through n. Your task is to find two distinct indices i and j such that segment ai lies within segment aj.

Segment [l1, r1] lies within segment [l2, r2] iff l1 ≥ l2 and r1 ≤ r2.

Print indices i and j. If there are multiple answers, print any of them. If no answer exists, print -1 -1.

Input

The first line contains one integer n (1 ≤ n ≤ 3·105) — the number of segments.

Each of the next n lines contains two integers li and ri (1 ≤ li ≤ ri ≤ 109) — the i-th segment.

Output

Print two distinct indices i and j such that segment ai lies within segment aj. If there are multiple answers, print any of them. If no answer exists, print -1 -1.

Examples

Input

5
1 10
2 9
3 9
2 3
2 9


Output

2 1


Input

3
1 5
2 6
6 20


Output

-1 -1

Note

In the first example the following pairs are considered correct:

  * (2, 1), (3, 1), (4, 1), (5, 1) — not even touching borders; 
  * (3, 2), (4, 2), (3, 5), (4, 5) — touch one border; 
  * (5, 2), (2, 5) — match exactly. 
import java.util.*;
import java.io.*;

public class C976 {
	
	public static void main(String[] args) throws Exception {
		
		int n = i();
		TreeSet<segment> line = new TreeSet<segment>();
		boolean over = false;
		int small = -1, big = -1;
		for (int i = 1; i <= n; i++) {
			segment temp = new segment(i, i(), i());
			if (!line.add(temp)) {
				over = true;
				small = i;
				big = temp.same;
			}
		}

		if (over) {
			out.println(small + " " + big);
		} else {
			int maxs = -1;
			int maxi = -1;
			for (segment seg : line) {
				if (maxs >= seg.s) {
					small = seg.i;
					big = maxi;
					break;
				} else if (seg.s > maxs) {
					maxs = seg.s;
					maxi = seg.i;
				}
			}

			out.println(small + " " + big);
		}


		out.close();
	}

	static class segment implements Comparable<segment> {
		int i, f, s;
		int same = -1;
		public segment(int a, int b, int c) {
			i = a; f = b; s = c;
		}

		public int compareTo(segment o) {
			if (f == o.f) {
				if (s == o.s) same = o.i;
				return o.s - s;
			}
			return f - o.f;
		}
	}

	static BufferedReader in;
	static StringTokenizer st = new StringTokenizer("");
	static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
	static {
		try {
			in = new BufferedReader(new FileReader("cf.in"));
		} catch (Exception e) {
			in = new BufferedReader(new InputStreamReader(System.in));
		}
	}
	static void check() throws Exception {
		if (!st.hasMoreTokens()) st = new StringTokenizer(in.readLine());
	}
	static int i() throws Exception {check(); return Integer.parseInt(st.nextToken());}
	static String s() throws Exception {check(); return st.nextToken();}
	static double d() throws Exception {check(); return Double.parseDouble(st.nextToken());}
	static long l() throws Exception {check(); return Long.parseLong(st.nextToken());}
}
