#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10,M=1e6+10;
int a[N],n, b[M],ans1,ans2;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i];
if(b[a[i]]){cout<<min(b[a[i]],i)<<' '<<max(b[a[i]],i);return 0;}
else b[a[i]]=i;
}
for(int i=1;i<=1e6;i++)if(b[i])
{
for(int j=i<<1;j<=1e6;j+=i)
{
if(b[j]){cout<<min(b[i],b[j])<<' '<<max(b[j],b[i]);return 0;}
}
}
cout<<-1;
}