#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long a[100001];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
    a[i] = a[i] * 1000001 + i;
  }
  sort(a, a + n);
  a[n] = a[n - 1] * 2;
  int m = 0, l, j = 0, ta, tb;
  for (int i = 1; i <= n; i++)
    if ((a[i] / 1000001 - a[j] / 1000001) > 0) {
      if (i - j > m ||
          (i - j == m && a[i - 1] % 1000001 - a[j] % 1000001 < tb - ta)) {
        m = i - j;
        tb = a[i - 1] % 1000001;
        ta = a[j] % 1000001;
      }
      j = i;
    }
  printf("%d %d\n", ta + 1, tb + 1);
  return 0;
}
