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>
#pragma GCC optimize("-O2")
using namespace std;
void err(istream_iterator<string> it) { cerr << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\t";
  err(++it, args...);
}
template <typename T1, typename T2>
ostream& operator<<(ostream& c, pair<T1, T2>& v) {
  c << "(" << v.first << "," << v.second << ")";
  return c;
}
template <template <class...> class TT, class... T>
ostream& operator<<(ostream& out, TT<T...>& c) {
  out << "{ ";
  for (auto& x : c) out << x << " ";
  out << "}";
  return out;
}
const int LIM = 1e7 + 5, MOD = 1e9 + 7;
int t, n, m, k, x, y, w;
int a[LIM], b[LIM], c[LIM];
long long ans = 1e17;
int ansx = -1, ansy = -1;
int lpf[LIM];
vector<int> pr;
void sieve() {
  lpf[1] = 1;
  for (int i = 2; i < LIM; ++i) {
    if (!lpf[i]) {
      pr.push_back(i);
      for (int j = i; j < LIM; j += i) lpf[j] = i;
    }
  }
}
vector<pair<int, int> > fac;
int ind = 0;
void dfs(int i, int cur) {
  if (fac.size() == i) {
    if (b[cur] != 0) {
      long long cans = c[b[cur]] * (long long)c[ind] / cur;
      if (cans < ans) ans = cans, ansx = b[cur], ansy = ind;
    } else
      b[cur] = ind;
  } else {
    for (int j = 0; j < fac[i].second + 1; ++j)
      dfs(i + 1, cur), cur *= fac[i].first;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  sieve();
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (a[x] != 0 && ans > x) ans = x, ansx = a[x], ansy = i + 1;
    a[x] = i + 1;
    c[i + 1] = x;
  }
  for (int j = 0; j < LIM; ++j) {
    if (a[j] == 0) continue;
    ind = a[j];
    int cur = j;
    fac.clear();
    while (cur > 1) {
      int cf = lpf[cur], c = 0;
      while (cur % cf == 0) c++, cur /= cf;
      fac.push_back(make_pair(cf, c));
    }
    dfs(0, 1);
  }
  if (ansx > ansy) swap(ansx, ansy);
  cout << ansx << " " << ansy << '\n';
  return 0;
}
