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;
long long fastmul(long long a, long long b) {
  if (b == 0) return 0;
  if (b == 1) return a;
  long long tmp = fastmul(a, b >> 1);
  return (b & 1) ? ((tmp << 1) + a) % 1000000007LL : (tmp << 1) % 1000000007LL;
}
struct Point {
  double x, y;
  Point() {}
  Point(double A, double B) : x(A), y(B) {}
};
struct Vec {
  double x, y;
  Vec() {}
  Vec(double A, double B) : x(A), y(B) {}
};
struct line {
  double a, b, c;
  line() {}
  line(double A, double B, double C) : a(A), b(B), c(C) {}
  line(Point A, Point B) {
    a = A.y - B.y;
    b = B.x - A.x;
    c = -a * A.x - b * A.y;
  }
};
Point intersect(line AB, line CD) {
  AB.c = -AB.c;
  CD.c = -CD.c;
  double D = (AB.a * CD.b - AB.b * CD.a);
  double Dx = (AB.c * CD.b - AB.b * CD.c);
  double Dy = (AB.a * CD.c - AB.c * CD.a);
  if (D == 0.0)
    return Point(1e9, 1e9);
  else
    return Point(Dx / D, Dy / D);
}
struct matrix {
  long long a[2 + 5][2 + 5];
  matrix() {}
};
matrix matmul(matrix A, matrix B) {
  matrix c;
  for (int i = 1; i <= 2; i++)
    for (int j = 1; j <= 2; j++) {
      c.a[i][j] = 0;
      for (int k = 1; k <= 2; k++)
        c.a[i][j] = (c.a[i][j] + fastmul(A.a[i][k], B.a[k][j])) % 1000000007LL;
    }
  return c;
}
int n, x, res = 0, cnt[1000005], Start[1000005], Stop[1000005], luui = 0,
          luuj = 0;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= 1000000; i++) Start[i] = long(1e9);
  for (int i = 1; i <= n; i++) {
    cin >> x;
    cnt[x]++;
    Start[x] = min(Start[x], i);
    Stop[x] = max(Stop[x], i);
    res = max(res, cnt[x]);
  }
  int RES = long(1e9);
  for (int i = 1; i <= 1000000; i++) {
    if (cnt[i] == res) {
      if (Stop[i] - Start[i] + 1 < RES) {
        RES = Stop[i] - Start[i] + 1;
        luui = Start[i];
        luuj = Stop[i];
      }
    }
  }
  cout << luui << ' ' << luuj;
  return 0;
}