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 three {

	public static void main(String[] args) throws IOException, FileNotFoundException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader in = new BufferedReader(new FileReader("three"));

		int n = Integer.parseInt(in.readLine());
		int[] arr = new int[n];
		StringTokenizer st = new StringTokenizer(in.readLine());
		HashMap<Integer, Integer> map  = new HashMap<>();
		int[][] bounds = new int[(int)(1e6+10)][2];
		//int[][] bounds = new int[4][2];

		
		for (int i=0; i<bounds.length; i++) {
			bounds[i][0] = n+1;
		}
		for (int i=0; i<n; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
			map.put(arr[i], map.getOrDefault(arr[i], 0)+1);
			bounds[arr[i]][0] = Math.min(i, bounds[arr[i]][0]);
			bounds[arr[i]][1] = Math.max(i, bounds[arr[i]][1]);
		}
		
		int maxcount=0;
		for (Integer a : map.keySet()) {
			maxcount = Math.max(maxcount, map.get(a));
		}
		int[] ret = new int[2]; ret[1] = n+2;
		for (Integer a : map.keySet()) {
			if (map.get(a) != maxcount) continue;
			if (bounds[a][1] - bounds[a][0] < ret[1] - ret[0]) {
				ret[1] = bounds[a][1];
				ret[0] = bounds[a][0];
			}
			//min = Math.min(min, bounds[a][1] - bounds[a][0]);
		}
		
		System.out.println(ret[0]+1 + " " + (1+ret[1]));
		
		
//		int min=1;
//		int max=n;
//		while (min<max) {
//			int middle = (max + min)/2;
//			if (check(middle, maxcount, arr, n)[0] != -1) {
//				min = middle;
//			}
//			else max = middle-1;
//		}
		
	}
	
//	public static int[] check(int middle, int maxcount, int[] arr, int n) {
//		int[] ret = {-1,-1};
//		HashMap<Integer, Integer> val = new HashMap<>();
//		TreeMap<Integer, ArrayList<Integer>> count = new TreeMap<>();
//		for (int i=0; i<middle; i++) {
//			if (val.containsKey(arr[i])) {
//				count.get(val.get(arr[i])).remove(arr[i]);
//				if (count.get(val.get(arr[i])).size() == 0) count.remove(val.get(arr[i]));
//			}
//			
//			val.put(arr[i], val.getOrDefault(arr[i], 0)+1);
//			if (!count.containsKey(val.get(arr[i])))  {
//				count.put(val.get(arr[i]), new ArrayList<>());
//			}
//			
//			count.get(val.get(arr[i])).add(arr[i]);
//			
//		}
//		
//		if (count.get(key))
		
//	}
 
}