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.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class B {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    public static void main(String[] args) throws IOException {
        try {
            in = new BufferedReader(new FileReader("quarth.in"));
            out = new PrintWriter(new File("quarth.out"));
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        tok = new StringTokenizer("");
        new B().solve();
        out.flush();
        out.close();
    }

    String nextTok() throws IOException {
        if (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

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

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

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

    static class Pair implements Comparable<Pair>  {
        int x;
        int y;
        int cnt;

        Pair (int cnt, int x, int y) {
            this.x = x;
            this.y = y;
            this.cnt = cnt;
        }

        @Override
        public int compareTo(Pair o) {
            if (cnt < o.cnt) return -1;
            if (cnt > o.cnt) return 1;

            return 0;
        }
    }

    void solve() throws IOException {
        int n = nextInt();
        Pair[] p = new Pair[1000010];
        for (int i = 0; i < n; i++) {
            int tmp = nextInt();
            if (p[tmp] == null) {
                p[tmp] = new Pair(1,i+1,i+1);
            } else {
                p[tmp].cnt++;
                p[tmp].y = i+1;
            }
        }
        for (int i = 0; i < p.length; i++) {
            if (p[i] == null) {
                p[i] = new Pair(0,0,0);
            }
        }
        Arrays.sort(p);
        int max = p[1000009].cnt;
        int a = 0;
        int b = 10000000;
        for (int i = p.length-1; i > 0; i--) {
            if (p[i].cnt == max) {
                if (p[i].y - p[i].x < b - a) {
                    a = p[i].x;
                    b = p[i].y;
                }
            } else break;
        }
        System.out.println(a+" "+b);
    }
}