Problem: 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

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

public class Main {

    private final static int inf = 1000000007;

    public static void main(String args[]) throws NumberFormatException,
            IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int i, j;
        int n = readInt(br);
        int[] a = readArray(br);
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();
        int[] s = new int[1000001];
        int[] e = new int[1000001];
        int[] occ = new int[1000001];
        for (i=0;i<1000001;i++) {
            s[i]  = -1;
            e[i] = -1;
            occ[i] = 0;
        }
        for (i=0;i<n;i++) {
            if (s[a[i]] == -1) {
                s[a[i]] = i;
                e[a[i]] = i;
            } else {
                e[a[i]] = i;
            }
            occ[a[i]]++;
        }
        int diff = 0;
        int occurance = 0;
        int finalS = 0, finalE = 0;
        for (i=0;i<n;i++) {
            //System.out.println(i + " = " + e[a[i]] + ", " + s[a[i]] + ", " + occ[a[i]]);
            if (occ[a[i]]>occurance) {
                diff = e[a[i]] - s[a[i]];
                occurance = occ[a[i]];
                finalS = s[a[i]]+1;
                finalE = e[a[i]]+1;
            } else if (occ[a[i]] == occurance && (diff > e[a[i]] - s[a[i]])) {
                diff = e[a[i]] - s[a[i]];
                occurance = occ[a[i]];
                finalS = s[a[i]]+1;
                finalE = e[a[i]]+1;
            }
        }
        System.out.println(finalS + " " + finalE);
    }

    public static long knapSack(int[] w, int[] val, int W, int n) {
        Long[][] t = new Long[n + 1][W + 1];
        int i, j;
        for (i = 0; i <= n; i++) {
            for (j = 0; j <= W; j++) {
                if (i == 0 || j == 0) {
                    t[i][j] = 0l;
                } else if (j >= w[i - 1] && (j - w[i - 1]) < W) {
                    t[i][j] = Math.max(t[i - 1][j], val[i - 1]
                            + t[i - 1][j - w[i - 1]]);
                } else {
                    t[i][j] = t[i - 1][j];
                }
            }
        }
        return t[n][W];
    }

    public static int readInt(BufferedReader br) throws NumberFormatException,
            IOException {
        return Integer.parseInt(br.readLine());
    }

    public static long readLong(BufferedReader br)
            throws NumberFormatException, IOException {
        return Long.parseLong(br.readLine());
    }

    public static int[] readArray(BufferedReader br) throws IOException {
        String[] arr = br.readLine().split(" ");
        int[] a = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            a[i] = Integer.parseInt(arr[i]);
        }
        return a;
    }

    public static long[] readLongArray(BufferedReader br) throws IOException {
        String[] arr = br.readLine().split(" ");
        long[] a = new long[arr.length];
        for (int i = 0; i < arr.length; i++) {
            a[i] = Long.parseLong(arr[i]);
        }
        return a;
    }

    public static TreeMap<String, String> sortMap(Map<String, String> map)
            throws IOException {
        ValueComparator valueComparator = new ValueComparator(map);
        TreeMap<String, String> sorted_map = new TreeMap<String, String>(
                valueComparator);
        return sorted_map;
    }
}

class ValueComparator implements Comparator<String> {

    Map<String, String> base;

    public ValueComparator(Map<String, String> map) {
        this.base = map;
    }

    // Note: this comparator imposes orderings that are inconsistent with
    // equals.
    public int compare(String a, String b) {
        if (base.get(a).compareTo(base.get(b)) >= 0) {
            return -1;
        } else {
            return 1;
        } // returning 0 would merge keys
    }
}