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.beans.Visibility;
import java.io.BufferedReader;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class CodeForces {

	static int OO = (int) -1e9 + 7;
	static int n, m;
	static int[] arr;
	static Integer[][] memo;
	static boolean[][] vis;

	static int dp(int idx, int prev) {

		if (idx == n - 1)
			return 0;
		if (memo[idx][prev] != null)
			return memo[idx][prev];
		int max = OO;
		int max1 = OO;
		if (idx == 1) {
			max = Math.max(max, Math.abs(1 - arr[idx]) + dp(idx + 1, arr[idx]));
			max1 = Math.max(max, Math.abs(1 - arr[idx - 1]) + dp(idx + 1, 1));
		} else {
			max = Math.max(max, Math.abs(prev - arr[idx]) + dp(idx + 1, arr[idx]));
			max1 = Math.max(max, Math.abs(prev - 1) + dp(idx + 1, 1));
		}
		return memo[idx][prev] = Math.max(max1, max);
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);

		int n = sc.nextInt();
		Pair[] arr = new Pair[(int) 1e6 + 7];
		int[] count = new int[(int) 1e6 + 7];

		for (int i = 0; i < arr.length; i++)
			arr[i] = new Pair(-1, -1);

		int beauty = -1;
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			count[a]++;
			beauty = Math.max(beauty, count[a]);
			if (arr[a].x == -1) {
				arr[a].x = i + 1;
			} else {
				arr[a].y = i + 1;
			}
		}
		int min = Integer.MAX_VALUE;
		Pair ans = new Pair(0, 0);
		for (int i = 0; i < count.length; i++) {
			if (count[i] == beauty) {
				if (arr[i].y - arr[i].x < min && arr[i].y != -1) {
					min = arr[i].y - arr[i].x;
					ans = arr[i];
				}
			}
		}
		System.out.println(beauty!=1?ans:1+" "+1);

	}

	static class Pair implements Comparable<Pair> {

		int x, y;

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

		public int compareTo(Pair o) {

			return x - o.x;
		}

		public String toString() {
			return x + " " + y;
		}

	}

	static class Edge implements Comparable<Edge> {
		int node, cost;

		Edge(int a, int b) {
			node = a;
			cost = b;
		}

		public int compareTo(Edge e) {
			if (cost != e.cost)
				return cost - e.cost;
			return node - e.node;
		}

		public String toString() {
			return node + " " + cost;
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}