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.OutputStream;
import java.util.Arrays;
import java.util.function.IntConsumer;
import java.io.IOException;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
import java.io.UncheckedIOException;
import java.io.Closeable;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        new TaskAdapter().run();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            GMinimumPossibleLCM solver = new GMinimumPossibleLCM();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class GMinimumPossibleLCM {
        void add(int[] pq, int x) {
            int size = pq[2];
            if (size < 2) {
                pq[size] = x;
                pq[2]++;
                if (size == 1 && pq[1] < pq[0]) {
                    SequenceUtils.swap(pq, 0, 1);
                }
            } else {
                if (pq[0] > x) {
                    pq[1] = pq[0];
                    pq[0] = x;
                } else if (pq[1] > x) {
                    pq[1] = x;
                }
            }
        }

        void addAll(int[] a, int[] b) {
            for (int i = 0; i < b[2]; i++) {
                add(a, b[i]);
            }
        }

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.ri();
            int L = (int) 1e7;
            int[] a = in.ri(n);
            int[][] pq = new int[L + 1][3];
            for (int i = 0; i < n; i++) {
                add(pq[a[i]], a[i]);
            }
            EratosthenesSieve.sieve(L, p -> {
                for (int i = L / p; i >= 1; i--) {
                    addAll(pq[i], pq[i * p]);
                }
            });
            long lcm = (long) 1e18;
            int x = 0;
            int y = 0;
            for (int i = 1; i <= L; i++) {
                if (pq[i][2] == 2) {
                    long cand = (long) pq[i][0] * pq[i][1] / i;
                    if (cand < lcm) {
                        lcm = cand;
                        x = -pq[i][0];
                        y = -pq[i][1];
                    }
                }
            }

            for (int i = 0; i < n; i++) {
                if (a[i] == -x) {
                    x = i;
                } else if (a[i] == -y) {
                    y = i;
                }
            }
            if (x > y) {
                x ^= y;
                y ^= x;
                x ^= y;
            }

            out.append(x + 1).append(' ').append(y + 1);
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

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

        public void populate(int[] data) {
            for (int i = 0; i < data.length; i++) {
                data[i] = readInt();
            }
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int ri() {
            return readInt();
        }

        public int[] ri(int n) {
            int[] ans = new int[n];
            populate(ans);
            return ans;
        }

        public int readInt() {
            boolean rev = false;

            skipBlank();
            if (next == '+' || next == '-') {
                rev = next == '-';
                next = read();
            }

            int val = 0;
            while (next >= '0' && next <= '9') {
                val = val * 10 - next + '0';
                next = read();
            }

            return rev ? val : -val;
        }

    }

    static class SequenceUtils {
        public static void swap(int[] data, int i, int j) {
            int tmp = data[i];
            data[i] = data[j];
            data[j] = tmp;
        }

    }

    static class EratosthenesSieve {
        public static void sieve(int n, IntConsumer consumer) {
            if (n <= 1) {
                return;
            }
            int block = DigitUtils.roundToInt(Math.sqrt(n));
            boolean[] isComp = new boolean[block + 1];
            int[] primes = new int[block + 1];
            int primeCnt = 0;
            for (int i = 2; i <= block; i++) {
                if (isComp[i]) {
                    continue;
                }
                primes[primeCnt++] = i;
                for (int j = i + i; j <= block; j += i) {
                    isComp[j] = true;
                }
            }
            for (int i = 0; i < primeCnt; i++) {
                int p = primes[i];
                consumer.accept(p);
            }
            for (int l = block + 1; l <= n; l += block) {
                int r = Math.min(l + block - 1, n);
                Arrays.fill(isComp, false);
                for (int i = 0; i < primeCnt; i++) {
                    int p = primes[i];
                    if (r < p * p) {
                        break;
                    }
                    int top = Math.max(0, l - p * p);
                    int bot = p;
                    for (int j = (top + bot - 1) / bot * p + p * p; j <= r; j += p) {
                        isComp[j - l] = true;
                    }
                }
                for (int j = l; j <= r; j++) {
                    if (!isComp[j - l]) {
                        consumer.accept(j);
                    }
                }
            }
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private static final int THRESHOLD = 32 << 10;
        private OutputStream writer;
        private StringBuilder cache = new StringBuilder(THRESHOLD * 2);
        private static Field stringBuilderValueField;
        private char[] charBuf = new char[THRESHOLD * 2];
        private byte[] byteBuf = new byte[THRESHOLD * 2];

        static {
            try {
                stringBuilderValueField = StringBuilder.class.getSuperclass().getDeclaredField("value");
                stringBuilderValueField.setAccessible(true);
            } catch (Exception e) {
                stringBuilderValueField = null;
            }
            stringBuilderValueField = null;
        }

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        private void afterWrite() {
            if (cache.length() < THRESHOLD) {
                return;
            }
            flush();
        }

        public FastOutput(OutputStream writer) {
            this.writer = writer;
        }

        public FastOutput append(char c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput flush() {
            try {
                if (stringBuilderValueField != null) {
                    try {
                        byte[] value = (byte[]) stringBuilderValueField.get(cache);
                        writer.write(value, 0, cache.length());
                    } catch (Exception e) {
                        stringBuilderValueField = null;
                    }
                }
                if (stringBuilderValueField == null) {
                    int n = cache.length();
                    if (n > byteBuf.length) {
                        //slow
                        writer.write(cache.toString().getBytes(StandardCharsets.UTF_8));
//                writer.append(cache);
                    } else {
                        cache.getChars(0, n, charBuf, 0);
                        for (int i = 0; i < n; i++) {
                            byteBuf[i] = (byte) charBuf[i];
                        }
                        writer.write(byteBuf, 0, n);
                    }
                }
                writer.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                writer.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class DigitUtils {
        private DigitUtils() {
        }

        public static int roundToInt(double x) {
            return (int) round(x);
        }

        public static long round(double x) {
            if (x >= 0) {
                return (long) (x + 0.5);
            } else {
                return (long) (x - 0.5);
            }
        }

    }
}

