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.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
    static final long MOD = 1_000_000_007, INF = 1_000_000_000_000_000L;
    static final int INf = 1_000_000_000;
    static FastReader reader;
    static PrintWriter writer;
    public static void main(String[] args) {
        Thread t = new Thread(null, new O(), "Integer.MAX_VALUE", 100000000);
        t.start();
    }
    static class O implements Runnable {
        public void run() {
            try {
                magic();
            }
            catch (Exception e) {
                e.printStackTrace();
                System.exit(1);
            }
        }
    }
    static class FastReader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public FastReader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public FastReader(String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            byte[] buf = new byte[1000000];
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n') break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = (c == '-');
            if (neg) c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg) return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = (c == '-');
            if (neg) c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg) return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = (c == '-');
            if (neg) c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (c == '.') while ((c = read()) >= '0' && c <= '9') ret += (c - '0') / (div *= 10);
            if (neg) return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1) buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead) fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null) return;
            din.close();
        }
    }

    static void magic() throws IOException {
        reader = new FastReader();
        writer = new PrintWriter(System.out, true);
//        Calendar start = Calendar.getInstance();
//        start.setTime(new Date());
        int n = reader.nextInt();
        int MAX = 10000000;
        int occ1[] = new int[MAX+1];
        int occ2[] = new int[MAX+1];
        for(int i=1;i<=n;++i) {
            int x = reader.nextInt();
            if(occ1[x]==0) {
                occ1[x] = i;
            }
            else {
                occ2[x] = i;
            }
        }
        long ans = Long.MAX_VALUE, ans_idx1 = -1, ans_idx2 = -1,min1,min2,where_min1, where_min2;
        int i,j;
        for(i=1;i<=MAX;++i) {
            min1 = MAX+1; min2 = MAX+1; where_min1 = -1; where_min2 = -1;
            for(j=i;j<=MAX;j+=i) {
                if(occ2[j]!=0) {
                    if(j<=min1) {
                        min2 = min1;
                        min1 = j;
                        where_min2 =  where_min1;
                        where_min1 = occ1[j];
                    }
                    else if(j<min2) {
                        min2 = j;
                        where_min2 = occ1[j];
                    }
                    if(j<=min1) {
                        min2 = min1;
                        min1 = j;
                        where_min2 = where_min1;
                        where_min1 = occ2[j];
                    }
                    else if(j<min2) {
                        min2 = j;
                        where_min2 = occ2[j];
                    }
                }
                else if(occ1[j]!=0) {
                    if(j<=min1) {
                        min2 = min1;
                        min1 = j;
                        where_min2 = where_min1;
                        where_min1 = occ1[j];
                    }
                    else if(j<min2) {
                        min2 = j;
                        where_min2 = occ1[j];
                    }
                }
            }
            if(where_min2!=-1) {
                long ispe = (min1*min2)/i;
                if(ans>ispe) {
                    ans = ispe;
                    ans_idx1 = where_min1;
                    ans_idx2 = where_min2;
                }
            }
        }
        writer.println(min(ans_idx1, ans_idx2)+" "+max(ans_idx1, ans_idx2));
//        Calendar end = Calendar.getInstance();
//        end.setTime(new Date());
//        double exec_time_in_millis = end.getTimeInMillis() - start.getTimeInMillis();
//        writer.println("Execution time: "+exec_time_in_millis/1000);
    }
}