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.*;

public class Main {
    public static void main(String args[]) {new Main().run();}

    FastReader in = new FastReader();
    PrintWriter out = new PrintWriter(System.out);
    void run() {
        work();
        out.flush();
    }
    long mod=998244353;
    long gcd(long a,long b) {
        return a==0?b:gcd(b%a,a);
    }
    long inf=Long.MAX_VALUE/3;
    int maxn=10000003;
    int[] A;
    int r1=-1,r2=-1;
    int[] rec;
    int[] factor;
    long ret=inf;
    void work() {
        int n=ni();
        A=nia(n);
        rec=new int[maxn];
        Arrays.fill(rec,-1);
        factor=new int[maxn];
        for(int i=1;i<maxn;i++){
            factor[i]=i;
        }
        for(int i=2;i<maxn;i++){
            if(factor[i]==i){
                for(int j=i;(long)i*j<maxn;j++){
                    factor[i*j]=i;
                }
            }
        }
        boolean[] vis=new boolean[maxn];
        for(int i=0;i<n;i++){
            if(vis[A[i]]){
                if(ret>A[i]){
                    ret=A[i];
                    r1=rec[A[i]];
                    r2=i;
                }
                continue;
            }
            vis[A[i]]=true;
            List<Integer> l1=new ArrayList<>();
            List<Integer> l2=new ArrayList<>();
            int v=A[i];
            while(v!=1){
                int b=factor[v];
                int c=0;
                while(v%b==0){
                    c++;
                    v/=b;
                }
                l1.add(c);
                l2.add(b);
            }
            dfs(0,l1,l2,i,1);
        }
        out.print((r1+1)+" "+(r2+1));
    }

    private void dfs(int idx, List<Integer> l1, List<Integer> l2,int idx2,int cur) {
        if(idx==l1.size()){
            int idx3=rec[cur];
            if(idx3==-1){
                rec[cur]=idx2;
            }else{
                long d=(long)A[idx2]*A[idx3]/cur;
                if(d<ret){
                    ret=d;
                    r1=idx3;
                    r2=idx2;
                }
                if(A[idx2]<A[idx3]){
                    rec[cur]=idx2;
                }
            }
            return;
        }
        int v=l2.get(idx);
        int cnt=l1.get(idx);
        dfs(idx+1,l1,l2,idx2,cur);
        for(int i=0;i<cnt;i++){
            cur*=v;
            dfs(idx+1,l1,l2,idx2,cur);
        }
    }


    @SuppressWarnings("unused")
    private ArrayList<Integer>[] ng(int n, int m) {
        ArrayList<Integer>[] graph=(ArrayList<Integer>[])new ArrayList[n];
        for(int i=0;i<n;i++) {
            graph[i]=new ArrayList<>();
        }
        for(int i=1;i<=m;i++) {
            int s=in.nextInt()-1,e=in.nextInt()-1;
            graph[s].add(e);
            graph[e].add(s);
        }
        return graph;
    }

    private ArrayList<long[]>[] ngw(int n, int m) {
        ArrayList<long[]>[] graph=(ArrayList<long[]>[])new ArrayList[n];
        for(int i=0;i<n;i++) {
            graph[i]=new ArrayList<>();
        }
        for(int i=1;i<=m;i++) {
            long s=in.nextLong()-1,e=in.nextLong()-1,w=in.nextLong();
            graph[(int)s].add(new long[] {e,w});
            graph[(int)e].add(new long[] {s,w});
        }
        return graph;
    }

    private int ni() {
        return in.nextInt();
    }

    private long nl() {
        return in.nextLong();
    }
    private double nd() {
        return in.nextDouble();
    }
    private String ns() {
        return in.next();
    }

    private long[] na(int n) {
        long[] A=new long[n];
        for(int i=0;i<n;i++) {
            A[i]=in.nextLong();
        }
        return A;
    }

    private int[] nia(int n) {
        int[] A=new int[n];
        for(int i=0;i<n;i++) {
            A[i]=in.nextInt();
        }
        return A;
    }
}

class FastReader
{
    BufferedReader br;
    StringTokenizer st;
    InputStreamReader input;//no buffer
    public FastReader()
    {
        br=new BufferedReader(new InputStreamReader(System.in));
    }

    public FastReader(boolean isBuffer)
    {
        if(!isBuffer){
            input=new InputStreamReader(System.in);
        }else{
            br=new BufferedReader(new InputStreamReader(System.in));
        }
    }

    public boolean hasNext(){
        try{
            String s=br.readLine();
            if(s==null){
                return  false;
            }
            st=new StringTokenizer(s);
        }catch(IOException e){
            e.printStackTrace();
        }
        return true;
    }

    public String next()
    {   
        if(input!=null){
            try {
                StringBuilder sb=new StringBuilder();
                int ch=input.read();
                while(ch=='\n'||ch=='\r'||ch==32){
                    ch=input.read();
                }
                while(ch!='\n'&&ch!='\r'&&ch!=32){
                    sb.append((char)ch);
                    ch=input.read();
                }
                return sb.toString();
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        while(st==null || !st.hasMoreElements())//回车，空行情况
        {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    public int nextInt()
    {
        return (int)nextLong();
    }

    public long nextLong() {
        try {
            if(input!=null){
                long ret=0;
                int b=input.read();
                while(b<'0'||b>'9'){
                    b=input.read();
                }
                while(b>='0'&&b<='9'){
                    ret=ret*10+(b-'0');
                    b=input.read();
                }
                return ret;
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return Long.parseLong(next());
    }

    public double nextDouble()
    {
        return Double.parseDouble(next());
    }
}