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
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fucking interest
*******************************
Higher, higher, even higher, to the point you won’t even be able to see me
https://www.a2oj.com/Ladder16.html
*******************************
NEVER DO 300IQ CONTESTS EVER
300IQ AS WRITER = EXTRA NONO
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class x1154G
   {
      static int MAX = 10000000;
      public static void main(String omkar[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));  
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int[] arr = new int[N];
         st = new StringTokenizer(infile.readLine());
         for(int i=0; i < N; i++)
            arr[i] = Integer.parseInt(st.nextToken());
         int[] cnt = new int[MAX+1];
         for(int x: arr)
            cnt[x]++;
         int[][] vals = new int[MAX+1][2];
         for(int i=1; i <= MAX; i++)
            Arrays.fill(vals[i], -2);
         for(int f=1; f <= MAX; f++)
            for(int v=f; v <= MAX; v += f)
               if(cnt[v] >= 1)
               {
                  if(vals[f][0] == -2)
                     vals[f][0] = v;
                  else if(vals[f][1] == -2)
                  {
                     vals[f][1] = v;
                     Arrays.sort(vals[f]);
                  }
                  else
                  {
                     if(vals[f][1] > v)
                     {
                        vals[f][1] = v;
                        Arrays.sort(vals[f]);
                     }
                  }
               }
         //val to indeces
         int[] map1 = new int[MAX+1];
         int[] map2 = new int[MAX+1];
         for(int i=0; i < N; i++)
         {
            if(map1[arr[i]] > 0)
               map2[arr[i]] = i+1;
            else
               map1[arr[i]] = i+1;
         }
         long res = -1;
         int x = -1; int y = -1;
         for(int gcd=1; gcd <= MAX; gcd++)
            if(vals[gcd][1] != -2)
            {
               int[] ls = vals[gcd];
               int min = ls[0];
               int min2 = ls[1];
               long prod = (long)min*min2;
               prod /= gcd;
               if(res == -1 || res > prod)
               {
                  res = prod;
                  x = map1[min];
                  y = map1[min2];
               }
            }
         //duplicates
         if(res == -1)
            res = MAX;
         for(int i=1; i < Math.min(MAX, res); i++)
            if(cnt[i] >= 2)
            {
               x = map1[i];
               y = map2[i];
               break;
            }
         System.out.println(Math.min(x,y)+" "+Math.max(x,y));
      }
   }