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

public class BB {
    static BufferedReader in;
    static PrintWriter out;
    static {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter(new FileWriter("output.txt"));
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }
    static StringTokenizer st;
    static String nextString() {
        while(st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(in.readLine());
            } catch (IOException e) {
                System.err.println("Truble in reading");
            }
        }
        return st.nextToken();
    }
    static int nextInt() {
        return Integer.valueOf(nextString());
    }
    static long nextLong() {
        return Long.valueOf(nextString());
    }
    public static void main(String[] args) {
        int n = nextInt();
        int max = 1001000;
        List<Integer>[] list = new List[max];
        for(int i = 0; i < max; i++) {
            list[i] = new ArrayList<>();
        }
        for(int i = 0; i < n; i++) {
            list[nextInt()].add(i); 
        }
        int cnt = 0;
        for(int i = 0; i < max; i++) {
            if (cnt < list[i].size()) {
                cnt = list[i].size();
            }
        }
        Set<Integer> set = new HashSet<>();
        for(int i = 0; i < max; i++) {
            if (cnt == list[i].size()) {
                set.add(i);
            }
        }
        int dl = Integer.MAX_VALUE;
        int a_lf = 0;
        int a_r = 0;
        for(int dg : set) {
            List<Integer> ls = list[dg];
            if (dl > ls.get(ls.size()-1)-ls.get(0)) {
                dl = ls.get(ls.size()-1)-ls.get(0);
                a_lf = ls.get(0)+1;
                a_r = ls.get(ls.size()-1)+1;
            }
        }
        System.out.println(a_lf + " " + a_r);
        close();
    } 

    static void close() {
        try {
            in.close();
        } catch (IOException e) {
        }
        out.flush();
        out.close();
    }

    static class Pair implements Comparable<Pair>{
        int a;
        int b;
    
        Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }
    
        @Override
        public int compareTo(Pair other) {
            if (a == other.a) {
                return b - other.b;
            }
            return a-other.a;
        }

        public String toString() {return a+" "+b;}
    }
}