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.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Solution {
    static PrintWriter fop = new PrintWriter(System.out);


   static public class Pair  {
        int x , y , in;
        Pair(int x , int y ,int  in){
            this.x = x ;
            this.y = y ;
            this.in = in ;
        }


    }
    static  class sort implements Comparator<Pair> {

        @Override
        public int compare(Pair o1, Pair o2) {
            if (o1.x == o2.x)
                return o2.y - o1.y ;
            return o1.x - o2.x ;
        }
    }




    public static void main(String[] args) {

        FastScanner fsca = new FastScanner();

        int n = fsca.nextInt() ;
        ArrayList<Pair> list = new ArrayList<>() ;
        for (int i = 0; i <n ; i++) {
            list.add(new Pair(fsca.nextInt(), fsca.nextInt(), i+1));
        }

        Collections.sort(list , new sort());




        for (int i = 1; i <list.size() ; i++) {
            if ( list.get(i-1).y >= list.get(i).y ){
                System.out.println(list.get(i).in + " " + list.get(i-1).in);
                return;
            }

        }
        System.out.println((-1) + " " + (-1));
















        fop.flush();
        fop.close();


    }
    /*-----------------------------------------------------------------------------------------------------------------------------------------------*/


    static long gcd(long a, long b) {
        return (b == 0) ? a : gcd(b, a % b);
    }

    static int gcd(int a, int b) {
        return (b == 0) ? a : gcd(b, a % b);
    }


    static final Random random = new Random();

    static void ruffleSort(int[] a) {
        int n = a.length;//shuffle, then sort
        for (int i = 0; i < n; i++) {
            int oi = random.nextInt(n), temp = a[oi];
            a[oi] = a[i];
            a[i] = temp;
        }
        Arrays.sort(a);
    }

    static void ruffleSort(long[] a) {
        int n = a.length;//shuffle, then sort
        for (int i = 0; i < n; i++) {
            int oi = random.nextInt(n);
            long temp = a[oi];
            a[oi] = a[i];
            a[i] = temp;
        }
        Arrays.sort(a);
    }


    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

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

        int[][] readMat(int n, int m) {
            int a[][] = new int[n][m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    a[i][j] = nextInt();
            return a;
        }

        char[][] readCharMat(int n, int m) {
            char a[][] = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = next();
                for (int j = 0; j < m; j++)
                    a[i][j] = s.charAt(j);
            }
            return a;
        }


        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }

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

    static void print(int a[], int n) {
        for (int i = 0; i < n; i++)
            fop.append((a[i]) + " ");
        // fop.append("\n") ;
    }

    static void print(long a[], int n) {
        for (int i = 0; i < n; i++)
            fop.append((a[i]) + " ");
        // fop.append("\n") ;
    }
}
        