Amr has got a large array of size n. Amr doesn't like large arrays so he intends to make it smaller.

Amr doesn't care about anything in the array except the beauty of it. The beauty of the array is defined to be the maximum number of times that some number occurs in this array. He wants to choose the smallest subsegment of this array such that the beauty of it will be the same as the original array.

Help Amr by choosing the smallest subsegment possible.

Input

The first line contains one number n (1 ≤ n ≤ 105), the size of the array.

The second line contains n integers ai (1 ≤ ai ≤ 106), representing elements of the array.

Output

Output two integers l, r (1 ≤ l ≤ r ≤ n), the beginning and the end of the subsegment chosen respectively.

If there are several possible answers you may output any of them. 

Examples

Input

5
1 1 2 2 1


Output

1 5

Input

5
1 2 2 3 1


Output

2 3

Input

6
1 2 2 1 1 2


Output

1 5

Note

A subsegment B of an array A from l to r is an array of size r - l + 1 where Bi = Al + i - 1 for all 1 ≤ i ≤ r - l + 1


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import static java.lang.Math.*;
import java.math.*;
import java.text.DecimalFormat;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        // Scanner in = new Scanner(System.in);
        Reader.init(System.in);
        int n = Reader.nextInt();
        int[] a = new int[n];
        int[] b = new int[1000001];
        int[][] arr = new int[2][1000001];

        HashMap<Integer, Integer> m = new HashMap<>();
        HashMap<Integer, Integer> d = new HashMap<>();
        int max = 0;
        for (int i = 0; i < n; i++) {
            int x = Reader.nextInt();
            b[x]++;
            if (b[x] > max) {
                max = b[x];
            }
            if (arr[0][x] == 0) {
                arr[0][x] = i + 1;
            } else {
                arr[1][x] = i + 1;
            }

        }
        int mn = Integer.MAX_VALUE;
        int f = 0, e = 0;
        for (int i = 0; i < b.length; i++) {

            if (b[i] == max) {
                if (arr[1][i] - arr[0][i] < mn) {
                    mn = arr[1][i] - arr[0][i];
                    f = arr[0][i];
                    e = arr[1][i];
                }
            }
        }

        System.out.println((e>0)?f + " " + e:f + " " + f);

    }

    static int Obe(long a, long b) {
        BigInteger b1 = new BigInteger("" + a);
        BigInteger b2 = new BigInteger("" + b);
        BigInteger gcd = b1.gcd(b2);
        return gcd.intValue();
    }

    static int che(int[] w) {
        Set<Integer> list = new LinkedHashSet<>();
        for (int i = 0; i < w.length; i++) {
            list.add(w[i]);
        }
        return list.size();
    }

    private static ArrayList<BigInteger> fibCache = new ArrayList<BigInteger>();

    static {
        fibCache.add(BigInteger.ZERO);
        fibCache.add(BigInteger.ONE);
    }

    public static BigInteger fib(int n) {
        if (n >= fibCache.size()) {
            fibCache.add(n, fib(n - 1).add(fib(n - 2)));
        }

        return fibCache.get(n);
    }

}

class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer("");
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

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

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());

    }

}
