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.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class AmrAndTheLargeArray {
	public static BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
	public static StringTokenizer st;
	
	public static void main(String[] args) throws IOException {
		int n = nextInt();
		int[] a = intArray(n);
		Map<Integer, Integer> mapCount = new HashMap<Integer, Integer>();
		Map<Integer, Integer> mapFirst = new HashMap<Integer, Integer>();
		Map<Integer, Integer> mapLast = new HashMap<Integer, Integer>();
		
		for (int i = 0; i < n; i++) {
			int x = a[i];
			if (mapCount.containsKey(x))
				mapCount.put(x, mapCount.get(x)+1);
			else {
				mapCount.put(x, 1);
				mapFirst.put(x, i);
			}
			
			mapLast.put(x, i);
		}
		
		int max = 0;
		for (int x : mapCount.keySet())
			max = Math.max(max, mapCount.get(x));
		
		int l = 0;
		int r = n;
		for (int x : mapCount.keySet())
			if (mapCount.get(x) == max)
				if (mapLast.get(x)-mapFirst.get(x) < r-l) {
					r = mapLast.get(x);
					l = mapFirst.get(x);
				}
		
		System.out.println((l+1) + " " + (r+1));
	}
	
	public static String nextLine() throws IOException {
		return f.readLine();
	}
	
	public static String nextString() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(f.readLine());
		return st.nextToken();
	}
	
	public static int nextInt() throws IOException {
		return Integer.parseInt(nextString());
	}
	
	public static long nextLong() throws IOException {
		return Long.parseLong(nextString());
	}
	
	public static int[] intArray(int n) throws IOException {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}
	
	public static long[] longArray(int n) throws IOException {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}