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.*;
import java.util.*;

public class Main {

    public static void main(String args[]) throws IOException {
        Reader.init(System.in);
        int n = Reader.nextInt(); 
      final int MAX = (int ) 1e6+2;
     int numbers [] = new int [n];
        for (int i = 0; i < n; i++) {
            numbers[i] = Reader.nextInt();
        }
        int left[] = new int [MAX];
        int reight[] = new int [MAX];
        int count[] = new int [MAX];
        for (int i = 0; i < n; i++) {
           int v = numbers[i];
           count[v]++;
           if(count[v]==1){
               left[v] =i;
           }
           reight[v]=i;
        }
       int mc = 0; 
        for (int i = 0; i < MAX; i++) {
            mc = Math.max(mc, count[i]);
        }
        int bestFrom = 0 ;
        int bestTo =n;
        for (int i = 0; i < MAX; i++) {
            if(count[i]==mc){
                if(reight[i] - left[i] <=bestTo - bestFrom){
                    bestFrom = left[i];
                    bestTo = reight[i];
                }
            }
        }
        System.out.println((bestFrom +1)+" "+(bestTo + 1  ));
        
    }

    private static boolean isSorted(int[] ar) {
        for (int i = 0; i < ar.length - 1; i++) {
            if (ar[i + 1] - ar[i] != 1) {
                return false;
            }
        }
        return true;
    }
}

class suger implements Comparable<suger> {

    double d;
    double c;

    public suger(double d, double c) {
        this.d = d;
        this.c = c;
    }

    @Override
    public int compareTo(suger o) {
        return Double.compare(this.c, o.c);
    }

}

class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /**
     * call this method to initialize reader for InputStream
     */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input));
        tokenizer = new StringTokenizer("");
    }

    /**
     * get next word
     */
    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
//            TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

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

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

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

    static public void nextIntArrays(int[]... arrays) throws IOException {
        for (int i = 1; i < arrays.length; ++i) {
            if (arrays[i].length != arrays[0].length) {
                throw new InputMismatchException("Lengths are different");
            }
        }
        for (int i = 0; i < arrays[0].length; ++i) {
            for (int[] array : arrays) {
                array[i] = nextInt();
            }
        }
    }

    static public void nextLineArrays(String[]... arrays) throws IOException {
        for (int i = 1; i < arrays.length; ++i) {
            if (arrays[i].length != arrays[0].length) {
                throw new InputMismatchException("Lengths are different");
            }
        }
        for (int i = 0; i < arrays[0].length; ++i) {
            for (String[] array : arrays) {
                array[i] = reader.readLine();
            }
        }
    }
}