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 double pi = 2 * acos(0.0);
const double eps = 1e-9;
const int MOD = (int)1e9 + 7;
long long pow(long long base, long long exp, long long mod) {
  long long result = 1;
  while (exp > 0) {
    if (exp & 1) result *= base;
    base *= base;
    if (base > mod) base %= mod;
    if (result > mod) result %= mod;
    exp /= 2;
  }
  return result;
}
long long mult(long long A, long long B) {
  if (B == 0) return 0;
  long long u = mult(A, B / 2);
  long long res;
  if (B % 2 == 0)
    res = u + u;
  else
    res = u + u + A;
  while (res >= MOD) res -= MOD;
  return res;
}
long long n, num;
vector<long long> nums;
void inp() {
  for (long long i = 0; i < n; i++) {
    cin >> num;
    nums.push_back(num);
  }
}
long long _sieve_size;
bitset<10000010> bs;
vector<int> primes;
void sieve(long long upperbound) {
  _sieve_size = upperbound + 1;
  bs.set();
  bs[0] = bs[1] = 0;
  for (long long i = 2; i <= _sieve_size; i++)
    if (bs[i]) {
      for (long long j = i * i; j <= _sieve_size; j += i) bs[j] = 0;
      primes.push_back((int)i);
    }
}
bool isprime(int a) {
  for (int i = 2; i * i <= a; i++)
    if (a % i == 0) return false;
  return true;
}
int lcs(string a, string b) {
  int arr[150][150];
  for (long long i = 0; i < a.size() + 1; i++) arr[i][0] = 0;
  for (long long j = 0; j < b.size() + 1; j++) arr[0][j] = 0;
  for (long long i = 1; i < a.size() + 1; i++)
    for (long long j = 1; j < b.size() + 1; j++) {
      if (a[i - 1] == b[j - 1])
        arr[i][j] = 1 + arr[i - 1][j - 1];
      else
        arr[i][j] = ((arr[i - 1][j]) > (arr[i][j - 1]) ? (arr[i - 1][j])
                                                       : (arr[i][j - 1]));
    }
  return arr[a.size()][b.size()];
}
bool sorted(int s, int e) {
  for (long long i = s; i < e; i++)
    if (nums[i] > nums[i + 1]) return false;
  return true;
}
bool comp(pair<int, pair<int, int> > a, pair<int, pair<int, int> > b) {
  if (a.first != b.first) return a.first > b.first;
  return (a.second.first - a.second.second + 1) <
         (b.second.first - b.second.second + 1);
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  inp();
  map<int, int> c, s, e;
  for (long long i = 0; i < n; i++) {
    c[nums[i]]++;
    e[nums[i]] = i;
    s[nums[i]] = -1;
  }
  for (long long i = 0; i < n; i++)
    if (s[nums[i]] == -1) s[nums[i]] = i;
  vector<pair<int, pair<int, int> > > ps;
  map<int, int>::iterator it;
  for (it = c.begin(); it != c.end(); ++it)
    ps.push_back(make_pair(it->second, make_pair(e[it->first], s[it->first])));
  sort((ps).begin(), (ps).end(), comp);
  cout << ps[0].second.second + 1 << " " << ps[0].second.first + 1;
  return 0;
}