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.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.InputMismatchException;

/**
 * @author Roman Dzhadan
 * @E-Mail dflash36@gmail.com
 * @Skype ronex36
 */

public class Main {

    public static IO type = IO.STANDART;

    public static int MEMORY_LIMIT = 256;
    public static int TIME_LIMIT = 2;

    public static String inputFileName = "input.txt";
    public static String outputFileName = "output.txt";

    public static InputReader in;
    public static OutputWriter out;

    public static void main(String[] args) throws IOException {
        configure();
        Task task = new Task();
        task.solve(in, out);
        out.close();
    }

    private static void configure() {
        if (type == IO.FILE) {
            try {
                InputStream fileIn = new FileInputStream(
                        new File(inputFileName));
                OutputStream fileOut = new FileOutputStream(new File(
                        outputFileName));
                in = new InputReader(fileIn);
                out = new OutputWriter(fileOut);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        if (type == IO.STANDART) {
            try {
                InputStream stdIn = System.in;
                OutputStream stdOut = System.out;
                in = new InputReader(stdIn);
                out = new OutputWriter(stdOut);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}

/* Your solution starts here: */
class Task {
    public void solve(InputReader in, OutputWriter out) {

        int n = in.readInt();
        int[]a = new int[n];
        int[]b = new int[n];
        int MIN = Integer.MAX_VALUE;
        int MAX = Integer.MIN_VALUE;
        for (int i = 0; i < n; i++) {
            a[i] = in.readInt();
            b[i] = in.readInt();
            MIN = Math.min(a[i], MIN);
            MAX = Math.max(b[i], MAX);
        }
        for (int i = 0; i < n; i++) {
            if (a[i] == MIN && b[i] == MAX) {
                System.out.println(i+1);
                return;
            }
        }
    
        System.out.println(-1);
    
    }
    
    public boolean validate(int val) {
        int[]num = new int[10];
        while (val != 0) {
            int x=val%10;
            num[x]++;
            val/=10;
        }
        int cnt = 0;
        for (int i = 0; i < num.length; i++) {
            if (num[i]!=0) cnt++;
        }
        if (cnt > 2) return false;
        else return true;
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(outputStream);
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }
}

class Utils {

    public static long MOD = 1000 * 1000 * 1000 + 9;

    public static boolean[] getEratosfenSieve(int size) {
        boolean[] prime = new boolean[size + 1];
        Arrays.fill(prime, true);
        prime[0] = prime[1] = false;
        for (int i = 2; i <= size; ++i)
            if (prime[i])
                if (i * 1L * i <= size * 1L)
                    for (int j = i * i; j <= size; j += i)
                        prime[j] = false;
        return prime;
    }

    public static int getCodeGray(int n) {
        return n ^ (n >> 1);
    }

    public static int gcd(int a, int b) {
        if (b == 0)
            return a;
        else
            return gcd(b, a % b);
    }

    public static int lcm(int a, int b) {
        return a / gcd(a, b) * b;
    }

    public static long binPower(long base, long exponent, long mod) {
        if (exponent == 0)
            return 1;
        long result = binPower(base, exponent >> 1, mod);
        result = result * result % mod;
        if ((exponent & 1) != 0)
            result = result * base % mod;
        return result;
    }
}

enum IO {
    FILE, STANDART
}