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.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.StringTokenizer;
import javafx.util.converter.BigIntegerStringConverter;
import java.util.*;

/**
 *
 * @author Ahmad
 */
public class JavaApplication1 {

    
    public static void main (String[] args) throws IOException, Exception {
      FastReader console = new FastReader();
      int n = console.nextInt() ; 
      ArrayList<seg> al=new ArrayList<seg>();
      int x[] = new int [n] ;
      int y[] = new int [n] ; 
      for (int i=0 ; i<n ; i++){
          al.add(new seg(console.nextInt(), console.nextInt())) ;
          x[i]=al.get(i).l ;
          y[i]=al.get(i).r ;
      }
      Collections.sort(al);
      int l = al.get(0).l ;
      int r = Integer.MIN_VALUE ; 
      int max = Integer.MIN_VALUE ; 
      int ind = 0 ; 
      for (int i=0 ; i<al.size() ; i++){
            if (al.get(i).l==l){
                if (al.get(i).r>r){
                    r=al.get(i).r ;
                    ind = i ; 
                }
            }
            else {
                break ; 
            }
      }
      int count = 0 ; 
      for (int i=0 ; i<al.size() ; i++){
          if (i!=ind){
          if (al.get(i).l>=l&&al.get(i).r<=r){
              count ++ ; 
          }
          else {
              break ; 
          }
          }
      }
      if (count+1==n){
          for (int i=0 ; i<n ; i++){
              if (l==x[i]&&r==y[i]){
                  System.out.println(i+1);
                  break ; 
              }
          }
      }
      else {
          System.out.println("-1");
      }
   }
}
class Sorting{
   
 public static int[] bucketSort(int[] array, int bucketCount) {

 if (bucketCount <= 0) throw new IllegalArgumentException("Invalid bucket count");

 if (array.length <= 1) return array; //trivially sorted

 

 int high = array[0];

 int low = array[0];

 for (int i = 1; i < array.length; i++) { //find the range of input elements

 if (array[i] > high) high = array[i];

 if (array[i] < low) low = array[i];

 }

 double interval = ((double)(high - low + 1))/bucketCount; //range of one bucket
 

 ArrayList<Integer> buckets[] = new ArrayList[bucketCount];

 for (int i = 0; i < bucketCount; i++) { //initialize buckets

 buckets[i] = new ArrayList();

 }

 

 for (int i = 0; i < array.length; i++) { //partition the input array
    
 buckets[(int)((array[i] - low)/interval)].add(array[i]);

 }
 

 int pointer = 0;

 for (int i = 0; i < buckets.length; i++) {

 Collections.sort(buckets[i]); //mergeSort

 for (int j = 0; j < buckets[i].size(); j++) { //merge the buckets

 array[pointer] = buckets[i].get(j);

 pointer++;

 }

}

return array;

}

}

class FastReader {

    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}
class seg implements Comparable<seg>{  
   int l;    
   int r ;  
   seg(int l,int r){  
     this.l=l;    
     this.r=r;  
}  
public int compareTo(seg st){  
    if(l==st.l)  
       return 0;  
    else if(l>st.l)  
       return 1;  
    else  
       return -1;  
   }  
}  
