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
/**
 * Created by Aminul on 4/23/2019.
 */

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

import static java.lang.Math.max;
import static java.lang.Math.min;

public class G {
    public static void main(String[] args) throws Exception {
        FastReader in = new FastReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int N = (int) 1e7 + 5;
        int n = in.nextInt();
        int f[] = new int[N];
        int a[] = new int[N];
        int b[] = new int[N];
        for (int i = 1; i <= n; i++) {
            int x = in.nextInt();
            if (f[x] == 0) {
                a[x] = i;
            } else if (f[x] == 1) {
                b[x] = i;
            }
            f[x]++;
        }

        long min = Long.MAX_VALUE, first = 1, second = 2;
        int g[] = new int[2], pos[] = new int[2];
        for (int i = 1; i < N; i++) {
            int cnt = 0;
            for (int j = i; j < N; j += i) {
                if (f[j] > 0) {
                    g[cnt] = j;
                    pos[cnt] = a[j];
                    cnt++;
                }
                if (cnt == 2) break;
                if (f[j] > 1) {
                    g[cnt] = j;
                    pos[cnt] = b[j];
                    cnt++;
                }
                if (cnt == 2) break;
            }
            if (cnt < 2) continue;
            long lcm = lcm(g[0], g[1]);
            if (lcm < min) {
                min = lcm;
                first = pos[0];
                second = pos[1];
            }
        }

        pw.println(min(first, second) + " " + max(first, second));

        pw.close();
    }

    static long gcd(long p, long q) {
        if (q == 0) return p;
        else return gcd(q, p % q);
    }

    static long lcm(long p, long q) {
        long g = gcd(p, q);
        p /= g;
        return p * q;
    }


    static void debug(Object... obj) {
        System.err.println(Arrays.deepToString(obj));
    }

    static class FastReader {
        InputStream is;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0, ptrbuf = 0;

        public FastReader(InputStream is) {
            this.is = is;
        }

        public int readByte() {
            if (lenbuf == -1) throw new InputMismatchException();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = is.read(inbuf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (lenbuf <= 0) return -1;
            }
            return inbuf[ptrbuf++];
        }

        public int nextInt() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            while (true) {
                if (b >= '0' && b <= '9') {
                    num = (num << 3) + (num << 1) + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }
    }
}