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

public class b312
{	
	public static void main(String[] args) throws Exception
	{
		InputReader in = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		int n=in.readInt();
		int a[][]=new int[1000005][3];
		
		int ar[]=new int[n];
		int max=0;int elem=0;
		int ind1=1;int ind2=99999999;
		for(int i=0;i<n;i++)
		{
			ar[i]=in.readInt();
			a[ar[i]][0]+=1;
			
			if(a[ar[i]][0]==1)a[ar[i]][1]=i+1;
			else a[ar[i]][2]=i+1;
			if(a[ar[i]][0]>max)
				max=a[ar[i]][0];
		}
		if(max==1){out.printLine("1 1");}
		else{
		for(int i=0;i<n;i++)
		{
			//out.printLine(max+" "+a[ar[i]][2]+" "+a[ar[i]][1]+" "+a[ar[i]][0]+" "+(ind2-ind1));
			if(max==a[ar[i]][0]&&(a[ar[i]][2]-a[ar[i]][1])<(ind2-ind1))
			{
				//out.printLine("True");
				ind1=a[ar[i]][1];
				ind2=a[ar[i]][2];
				
			}
		}
		out.printLine(ind1+" "+ind2);	}
		out.close();
	}


	private static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		 
		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}
 
		public int read()
		{
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				} catch (IOException e)
				{
					throw new InputMismatchException();
				}
				if (numChars <= 0)
				return -1;
			}
			return buf[curChar++];
		}
		public int readInt()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			int res = 0;
			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}
		
		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		
 
		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
 
	private static class OutputWriter
	{
		private final PrintWriter writer;
 
		public OutputWriter(OutputStream outputStream)
		{
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}
 
		public OutputWriter(Writer writer)
		{
			this.writer = new PrintWriter(writer);
		}
 		public void print(Object... objects)
		{
			for (int i = 0; i < objects.length; i++)
			{
				if (i != 0)
				writer.print(' ');
				writer.print(objects[i]);
			}
		}
		
 
		public void printLine(Object... objects)
		{
			print(objects);
			writer.println();
		}
 
		public void close()
		{
			writer.close();
		}
 
		public void flush()
		{
			writer.flush();
		}
 
	}
}