#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
int b[maxn];
map<int, vector<int> > a;
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    b[i] = x;
    if (!a.count(x)) {
      a[x] = vector<int>();
    }
    a[x].push_back(i + 1);
  }
  sort(b, b + n);
  int ms = 1, mi = 0x7fffffff;
  for (int i = 0; i < n; i++) {
    if (a[b[i]].size() > ms) {
      ms = a[b[i]].size();
    }
  }
  int l = 0, r = 0;
  if (ms == 1) {
    printf("1 1\n");
  } else {
    for (int i = 0; i < n; i++) {
      if (a[b[i]].size() == ms) {
        int temp = a[b[i]].size();
        int tt = a[b[i]][temp - 1] - a[b[i]][0];
        if (mi > tt) {
          mi = tt;
          l = a[b[i]][0];
          r = a[b[i]][temp - 1];
        }
      }
    }
    printf("%d %d\n", l, r);
  }
  return 0;
}
