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;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const long long INF = 1e18 + 99;
const long long MOD = 1e9 + 7;
inline long long two(long long n) { return 1 << n; }
inline void set_bit(long long& n, long long b) { n |= two(b); }
inline void unset_bit(long long& n, long long b) { n &= ~two(b); }
inline long long last_bit(long long n) { return n & (-n); }
inline long long ones(long long n) {
  long long res = 0;
  while (n && ++res) n -= n & (-n);
  return res;
}
template <class T>
void chmax(T& a, const T& b) {
  a = max(a, b);
}
template <class T>
void chmin(T& a, const T& b) {
  a = min(a, b);
}
template <class T>
T gcd(T a, T b) {
  return (b != 0 ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd<T>(a, b) * b);
}
template <typename T>
T exp(T b, T p) {
  T x = 1;
  while (p) {
    if (p & 1) x = (x * b);
    b = (b * b);
    p = p >> 1;
  }
  return x;
}
void boostIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long modpow(long long a, long long b) {
  long long res = 1;
  a %= MOD;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
  }
  return res;
}
const long long maxx = (long long)1e6 + 9;
long long st[maxx], occur[maxx], maxi = 0, mini = -INF, ch = 0;
int32_t main() {
  boostIO();
  long long n;
  cin >> n;
  for (long long i = 0; i < (n); i++) {
    long long a;
    cin >> a;
    if (occur[a] == 0) {
      occur[a]++;
      st[a] = i;
    } else
      occur[a]++;
    if (occur[a] > maxi) {
      maxi = occur[a];
      ch = st[a] + 1;
      mini = i - st[a] + 1;
    }
    if (occur[a] == maxi and i - st[a] + 1 < mini) {
      ch = st[a] + 1;
      mini = i - st[a] + 1;
    }
  }
  cout << ch << " " << ch + mini - 1 << "\n";
}