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.*;
//https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1428
public class Main {
	public static final long MOD = 1000000007;
	static int n;
	static int[][] arr = new int[3][1000001];
	static int[] sum;

	public static void main(String[] args) throws Exception
	{
		MyScanner input = new MyScanner();
		BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
		n = input.nextInt();
		int[] x = new int[n];
		for(int i = 0; i < n; i++)
		{
			x[i] = input.nextInt();
			if(arr[0][x[i]] == 0)
				arr[1][x[i]] = i;

			arr[2][x[i]] = i;
			arr[0][x[i]] ++;
		}
		int max = 0;
		int len = 0;
		int l = 0; int r = 0;
		for(int i = 0; i < arr[0].length; i++)
		{
			//System.out.println(i+" "+arr[0][i]);
			if(arr[0][i] > max)
			{
				max = arr[0][i];
				len = arr[2][i] - arr[1][i] + 1; 
				l = arr[1][i];
				r = arr[2][i];
				//      System.out.println(i);
			}
			else if(arr[0][i] == max)
			{
				if(Math.abs(arr[2][i] - arr[1][i] + 1) < r-l+1)
				{
					len = arr[2][i] - arr[1][i] + 1;
					l = arr[1][i];
					r = arr[2][i];
					//      System.out.println(i);
				}
			}
		}


		System.out.println((l+1) + " " + (r+1));

	}
	public static void print(int[] inf)
	{
		for(int i: inf)
			System.out.print(i+" ");
		System.out.println();
	}



	private static class MyScanner 
	{
		BufferedReader br;
		StringTokenizer st;

		public MyScanner(String s) 
		{

			try
			{
				br = new BufferedReader(new FileReader(s));
			} catch (IOException e)
			{
				e.printStackTrace();
			}

		}

		public MyScanner() 
		{
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer("");
		}

		public String next() 
		{
			if (st == null || !st.hasMoreElements()) 
			{
				try 
				{
					String line = br.readLine();
					if (line == null) {
						throw new UnknownError();
					}
					while (line.trim().equals("")) {
						line = br.readLine();
						if (line == null) {
							throw new UnknownError();
						}
					}
					st = new StringTokenizer(line);
				} 
				catch (IOException e) 
				{
					throw new UnknownError();
				}
			}
			return st.nextToken();
		}

		public String nextLine() {
			try {
				String line = br.readLine();
				if (line == null) {
					throw new UnknownError();
				}
				return line;
			}
			catch (IOException e) {
				throw new UnknownError();
			}
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

	}
}