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.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author beginner1010
 */
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);
        TaskG solver = new TaskG();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskG {
        final int MaxN = (int) 1e7 + 5;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            int[] freq = new int[MaxN];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
                freq[a[i]]++;
            }

            long bestLCM = Long.MAX_VALUE;
            long bestFirst = -1;
            long bestSecond = -1;
            for (int gcd = 1; gcd <= MaxN; gcd++) {
                ArrayList<Integer> chosen = new ArrayList<>();
                for (int num = gcd; num < MaxN; num += gcd) {
                    if (freq[num] >= 2) {
                        chosen.add(num);
                        if (chosen.size() == 1) chosen.add(num);
                    } else if (freq[num] == 1) {
                        chosen.add(num);
                    }
                    if (chosen.size() == 2)
                        break;
                }
                if (chosen.size() == 2) {
                    long first = chosen.get(0);
                    long second = chosen.get(1);
                    long lcm = first * second / gcd;
                    if (lcm < bestLCM) {
                        bestLCM = lcm;
                        bestFirst = first;
                        bestSecond = second;
                    }
                }
            }

            int id1 = -1;
            int id2 = -1;
            for (int i = 0; i < n; i++) {
                if (id1 == -1 && a[i] == bestFirst) {
                    id1 = i + 1;
                } else if (id2 == -1 && a[i] == bestSecond) {
                    id2 = i + 1;
                }
            }
            if (id1 > id2) {
                int temp = id1;
                id1 = id2;
                id2 = temp;
            }
            out.println(id1 + " " + id2);
        }

    }

    static class InputReader {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputStream stream;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isWhitespace(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isWhitespace(c));
            return res * sgn;
        }

    }
}

