A coordinate line has n segments, the i-th segment starts at the position li and ends at the position ri. We will denote such a segment as [li, ri].

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. 

Input

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.

Output

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.

Examples

Input

3
1 1
2 2
3 3


Output

-1


Input

6
1 5
2 3
1 10
7 10
7 7
10 10


Output

3

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;

	public class practice{
		public static void main(String[] args){
			FastScanner r = new FastScanner();
//			int t = r.i() ,n;
//			StringBuffer ans = new StringBuffer("");
//			while(t-->0) {
//				
//			}
//				
//			p(ans);
			
			
			int n = r.i();
			int[][] arr = new int[n][2];
			int min = Integer.MAX_VALUE,max = Integer.MIN_VALUE;
			for(int i=0;i<n;i++) {
				arr[i][0] = r.i();
				arr[i][1] = r.i();
				if(arr[i][0] < min) min = arr[i][0];
				if(arr[i][1] > max) max = arr[i][1];
			}
			
			for(int i=0;i<n;i++) 
				if(arr[i][0] <= min && arr[i][1] >= max) {
					p(i+1);
					return;
			}
		p("-1");
				
			
					
		}
		
		static ArrayList<ArrayList<Integer>> subsets(int n){
			//n=21 time = 1.5
			//n=20 time = 0.6
			//n=19 time = 0.4
			//n=18 time = 0.2
			//n=17 time = 0.1
			ArrayList<ArrayList<Integer>> arr = new ArrayList<>();
			ArrayList<Integer> just = new ArrayList<>();
			
			for(int i=1;i<=n;i++) just.add(i);
			arr.add(just);
			
			subsetsRecursiveFunc(arr,1,n,new ArrayList<Integer>());
			
			return arr;
		}
		protected static void subsetsRecursiveFunc(ArrayList<ArrayList<Integer>> arr, int k, int n, ArrayList<Integer> current) { 
			if(k== n+1) return;
			ArrayList<Integer> yo = new ArrayList<>(current);
			current.add(k);
			arr.add(yo);
			subsetsRecursiveFunc(arr,k+1,n,current);
			subsetsRecursiveFunc(arr,k+1,n,yo);
			
		}
		 
		static int gcd(int a, int b)
		{ 
		    if (a == 0)
		       return b*b;
		    if (b == 0)
		       return a*a;
		  
		 
		    if (a == b)
		        return a*a;
		  
		 
		    if (a > b)
		        return gcd(a-b, b);
		    return gcd(a, b-a);
		}
		
		static int lcm(int a, int b) {
			return (a*b)/gcd(a,b);
		}

		
		static boolean  isPrime(int n) {
			if(n <=1 )return false;
			if(n==2) return true;
			if(n%2==0) return false;
			for(int i=3;i<=Math.sqrt(n);i+=2)
				if(n%i==0) return false;
			return true;
		}
		static void incrementCount(HashMap<Integer,Integer> map, int key) {
			if(map.containsKey(key))
				map.put(key, map.get(key) +1);
			else
				map.put(key, 1);
		}
		
		private static int countDigits(int l) {
				if (l >= 1000000000) return 10;
				if (l >= 100000000) return 9;
				if (l >= 10000000) return 8;
				if (l >= 1000000) return 7;
				if (l >= 100000) return 6;
				if (l >= 10000) return 5;
				if (l >= 1000) return 4;
				if (l >= 100) return 3;
				if (l >= 10) return 2;
				return 1;
			}
		private static int countDigits(long l) {
				if (l >= 1000000000000000000L) return 19;
				if (l >= 100000000000000000L) return 18;
				if (l >= 10000000000000000L) return 17;
				if (l >= 1000000000000000L) return 16;
				if (l >= 100000000000000L) return 15;
				if (l >= 10000000000000L) return 14;
				if (l >= 1000000000000L) return 13;
				if (l >= 100000000000L) return 12;
				if (l >= 10000000000L) return 11;
				if (l >= 1000000000L) return 10;
				if (l >= 100000000L) return 9;
				if (l >= 10000000L) return 8;
				if (l >= 1000000L) return 7;
				if (l >= 100000L) return 6;
				if (l >= 10000L) return 5;
				if (l >= 1000L) return 4;
				if (l >= 100L) return 3;
				if (l >= 10L) return 2;
				return 1;
			}
		
		static void p(String s) {
			System.out.println(s);
		}
		static void p(StringBuffer s) {
			System.out.println(s);
		}
		
		static void p(int s) {
			System.out.println(s);
		}
		
		static void p(long s) {
			System.out.println(s);
		}
		
		static void p(double s) {
			System.out.println(s);
		}
		static void p(float s) {
			System.out.println(s);
		}
		static void p(char s) {
			System.out.println(s);
		}
		static void p(boolean s) {
			System.out.println(s);
		}
		static void p() {
			System.out.println();
		}
		static void pn(String s) {
			System.out.print(s);
		}
		
		
		static void pn(int s) {
			System.out.print(s);
		}
		
		static void pn(long s) {
			System.out.print(s);
		}
		
		static void pn(double s) {
			System.out.print(s);
		}
		static void pn(float s) {
			System.out.print(s);
		}
		static void pn(char s) {
			System.out.print(s);
		}
		static void pn(boolean s) {
			System.out.print(s);
		}
		

	}
		

	
	class FastScanner {
	    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	    StringTokenizer st=new StringTokenizer("");
	    String n() {
	        while (!st.hasMoreTokens())
	            try {
	                st=new StringTokenizer(br.readLine());
	            } catch (IOException e) {
	                e.printStackTrace();
	            }
	        return st.nextToken();
	    }
	    int[] ia(int n) {
	    	int[] arr = new int[n];
	    	for(int i=0;i<n;i++)
	    		arr[i] = i();
	    	return arr;
	    }
	    String[] sa(int n) {
	    	String[] arr = new String[n];
	    	for(int i=0;i<n;i++)
	    		arr[i] = n();
	    	return arr;
	    }
	    long[] la(int n) {
	    	long[] arr = new long[n];
	    	for(int i=0;i<n;i++)
	    		arr[i] = l();
	    	return arr;
	    }
	    String nl()
	    {
	        String str = "";
	        try
	        {
	            str = br.readLine();
	        }
	        catch (IOException e)
	        {
	            e.printStackTrace();
	        }
	        return str;
	    }

	    int i() {
	        return Integer.parseInt(n());
	    }
	    long l() {
	        return Long.parseLong(n());
	    }
	}
