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
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author cplayer
 */
public class Main {
    public static void main (String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        GMinimumPossibleLCM solver = new GMinimumPossibleLCM();
        solver.solve(1, in, out);
        out.close();
    }

    static class GMinimumPossibleLCM {
        private int maxn = 10000000;
        private int[] arr;
        private int[] data;
        long minLcm;
        long minFirst;
        long minSecond;

        private int gcd (int a, int b) {
            return b == 0 ? a : gcd(b, a % b);
        }

        private long lcm (int a, int b) {
            long res = a;
            res *= b;
            res /= gcd(a, b);
            return res;
        }

        public void solve (int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            data = new int[n];
            arr = new int[maxn + 1];
            for (int i = 0; i < n; ++i) {
                int tmp = in.nextInt();
                arr[tmp]++;
                data[i] = tmp;
            }
            minLcm = Long.MAX_VALUE;
            for (int g = 1; g <= maxn; ++g) {
                int first = -1, second = -1, findNum = 0;
                for (int k = g; k <= maxn; k += g) {
                    if (arr[k] > 0) {
                        if (findNum == 0) {
                            if (arr[k] > 1) {
                                first = second = k;
                                findNum = 2;
                                break;
                            } else {
                                first = k;
                                findNum += 1;
                            }
                        } else if (findNum == 1) {
                            if (arr[k] > 0) {
                                second = k;
                                findNum += 1;
                                break;
                            }
                        }
                    }
                }
                if (findNum == 2) {
                    long lcm = lcm(first, second);
                    if (lcm < minLcm) {
                        minLcm = lcm;
                        minFirst = first;
                        minSecond = second;
                    }
                }
            }
            int firstIdx = 0, secondIdx = 0;
            for (int i = 0; i < n; ++i) {
                if (data[i] == minFirst) {
                    firstIdx = i + 1;
                    break;
                }
            }
            for (int i = 0; i < n; ++i) {
                if (data[i] == minSecond && i != firstIdx - 1) {
                    secondIdx = i + 1;
                    break;
                }
            }
            if (firstIdx > secondIdx) {
                int tmp = firstIdx;
                firstIdx = secondIdx;
                secondIdx = tmp;
            }
            out.println(firstIdx + " " + secondIdx);
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader (InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next () {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt () {
            return Integer.parseInt(next());
        }

    }
}

