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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T, typename T1>
ostream& operator<<(ostream& out, pair<T, T1> obj) {
  return out << "(" << obj.first << "," << obj.second << ")";
}
template <typename T, typename T1>
ostream& operator<<(ostream& out, map<T, T1> cont) {
  typename map<T, T1>::const_iterator itr = cont.begin();
  typename map<T, T1>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
}
template <typename T,
          template <typename ELEM, typename ALLOC = allocator<ELEM>> class CONT>
ostream& operator<<(ostream& out, CONT<T> cont) {
  typename CONT<T>::const_iterator itr = cont.begin();
  typename CONT<T>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
}
template <typename T>
T gcd(T a, T b) {
  T min_v = min(a, b);
  T max_v = max(a, b);
  while (min_v) {
    T temp = max_v % min_v;
    max_v = min_v;
    min_v = temp;
  }
  return max_v;
}
int N, maxTime, min_length = -1, startPos, endPos;
int elements[100010], counts[1000010], start_pos[1000010];
vector<pair<int, int>> keep;
int main() {
  scanf("%d", &N);
  for (auto i = 0 - (0 > N); i != N - (0 > N); i += 1 - 2 * (0 > N))
    scanf("%d", elements + i);
  for (auto i = 0 - (0 > 1000010); i != 1000010 - (0 > 1000010);
       i += 1 - 2 * (0 > 1000010))
    start_pos[i] = -1;
  for (auto i = 0 - (0 > N); i != N - (0 > N); i += 1 - 2 * (0 > N))
    if (start_pos[elements[i]] == -1) start_pos[elements[i]] = i + 1;
  for (auto i = 0 - (0 > N); i != N - (0 > N); i += 1 - 2 * (0 > N)) {
    ++counts[elements[i]];
    if (counts[elements[i]] > maxTime) maxTime = counts[elements[i]];
  }
  for (auto i = 0 - (0 > 1000010); i != 1000010 - (0 > 1000010);
       i += 1 - 2 * (0 > 1000010))
    counts[i] = 0;
  for (auto i = 0 - (0 > N); i != N - (0 > N); i += 1 - 2 * (0 > N)) {
    ++counts[elements[i]];
    if (counts[elements[i]] == maxTime) keep.emplace_back(i + 1, elements[i]);
  }
  if (keep.size()) {
    for (auto i = 0 - (0 > keep.size()); i != keep.size() - (0 > keep.size());
         i += 1 - 2 * (0 > keep.size())) {
      int len = keep[i].first - start_pos[keep[i].second];
      if (min_length == -1 || len < min_length) {
        min_length = len;
        startPos = start_pos[keep[i].second];
        endPos = keep[i].first;
      }
    }
    printf("%d %d\n", startPos, endPos);
  } else
    printf("%d %d\n", 1, N);
  return 0;
}