You are given an array a consisting of n integers a_1, a_2, ..., a_n.

Your problem is to find such pair of indices i, j (1 ≤ i < j ≤ n) that lcm(a_i, a_j) is minimum possible.

lcm(x, y) is the least common multiple of x and y (minimum positive number such that both x and y are divisors of this number).

Input

The first line of the input contains one integer n (2 ≤ n ≤ 10^6) — the number of elements in a.

The second line of the input contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^7), where a_i is the i-th element of a.

Output

Print two integers i and j (1 ≤ i < j ≤ n) such that the value of lcm(a_i, a_j) is minimum among all valid pairs i, j. If there are multiple answers, you can print any.

Examples

Input


5
2 4 8 3 6


Output


1 2


Input


5
5 2 11 3 7


Output


2 4


Input


6
2 5 10 1 10 2


Output


1 4
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
using pii = pair<int, int>;
using vi = vector<int>;
using ll = long long;
const int N = 1e7, INF = 1e9;
int d1[N + 1], d2[N + 1], lp[N + 1], P[N + 1], sp = 0, b[8], e[8], p, di, nu,
                                               c[N + 1];
void sieve() {
  for (int i = int(2); i < int(N + 1); i++) {
    if (lp[i] == 0) lp[i] = i, P[sp++] = i;
    for (int j = 0; j < sp && P[j] <= lp[i] && i * P[j] <= N; j++)
      lp[i * P[j]] = P[j];
  }
}
void d(int l) {
  if (l == p) {
    int x = nu / di;
    if (x < d1[di])
      d2[di] = d1[di], d1[di] = x;
    else if (x < d2[di])
      d2[di] = x;
    return;
  }
  d(l + 1);
  int x = 1;
  for (int i = int(0); i < int(e[l]); i++) x *= b[l], di *= b[l], d(l + 1);
  di /= x;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  sieve();
  int n;
  cin >> n;
  vi a(n), g;
  for (int i = int(0); i < int(n); i++) {
    int x;
    cin >> x;
    a[i] = x;
    if (c[x] < 2) g.emplace_back(x), c[x]++;
  }
  int m = int((g).size());
  for (int i = int(1); i < int(N + 1); i++) d1[i] = d2[i] = INF;
  for (int i = int(0); i < int(m); i++) {
    p = -1, di = 1, nu = g[i];
    int x = g[i], y = -1;
    while (x != 1) {
      if (lp[x] == y)
        e[p]++;
      else
        y = b[++p] = lp[x], e[p] = 1;
      x /= lp[x];
    }
    p++;
    d(0);
  }
  ll r = 1e18, x = 0, y = 0;
  for (int i = int(1); i < int(N + 1); i++) {
    ll f = d1[i], s = d2[i];
    if (f != INF && s != INF) {
      ll z = f * s * i;
      if (z < r) r = z, x = f * i, y = s * i;
    }
  }
  for (int i = int(0); i < int(n); i++)
    if (x == a[i]) {
      x = i + 1;
      break;
    }
  for (int i = int(0); i < int(n); i++)
    if (y == a[i] && x != i + 1) {
      y = i + 1;
      break;
    }
  if (x > y) swap(x, y);
  cout << x << ' ' << y << '\n';
  return 0;
}
