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;
const int32_t MOD = 1000000007;
long long int prime[1000001] = {0}, ans = 0;
long long int pwe(long long int a, long long int b) {
  if (b == 0) return 1;
  long long int res = pwe(a, b / 2);
  res *= res;
  res %= MOD;
  if (b % 2)
    return (res * a) % MOD;
  else
    return (res);
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
void file() {}
long long int sumofdigits(long long int n) {
  long long int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
void sieve() {
  prime[0] = 0;
  prime[1] = 0;
  prime[2] = 1;
  long long int i, j, k;
  for (i = 3; i <= 1000001; i += 2) {
    prime[i] = 1;
  }
  for (i = 3; i <= 1000001; i++) {
    if (prime[i]) {
      for (j = i * i; j <= 1000001; j += 2 * i) prime[j] = 0;
    }
  }
}
bool cmp(pair<long long int, long long int> &a,
         pair<long long int, long long int> &b) {
  if (a.first != b.first) {
    return b.first > a.first;
  } else {
    return b.second > a.second;
  }
}
void solve() {
  long long int n, x;
  map<long long int, pair<long long int, long long int> > m;
  cin >> n;
  long long int ma = INT_MIN, in = INT_MIN;
  std::vector<long long int> v(n), h(1000001);
  for (long long int i = 0; i < n; ++i) {
    cin >> v[i], h[v[i]]++;
    m[v[i]].first = -1;
    m[v[i]].second = -1;
    ma = max(ma, h[v[i]]);
  }
  set<long long int> e;
  for (long long int i = 0; i <= 1000001 - 1; i++) {
    if (ma == h[i]) {
      ma = h[i];
      e.insert(i);
    }
  }
  long long int s = -1, en = -1;
  ma = INT_MAX;
  for (long long int i = 0; i < n; ++i) {
    if (e.count(v[i])) {
      if (m[v[i]].first == -1) {
        m[v[i]].first = i + 1;
      } else {
        m[v[i]].second = i + 1;
      }
    }
  }
  for (auto it : m) {
    if (it.second.first != -1 and it.second.second != -1) {
      if (it.second.second - it.second.first < ma) {
        ma = it.second.second - it.second.first;
        s = it.second.first;
        en = it.second.second;
      }
    }
  }
  if (s == -1 or en == -1) s = 1, en = 1;
  cout << s << " ";
  cout << en << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  { solve(); }
  return 0;
}