#include<bits/stdc++.h>
#define LL long long
using namespace std;
const int M=1e5+7;
int n,cnt;
LL a[M];
map<LL,int> mp;
LL check(LL x){
LL ret=(x&1)^0;
for(LL bit=1;bit<=63;bit++){
LL u1=(x&(1ll<<(bit-1)))?1:0;
LL u2=(ret&(1ll<<(bit-1)))?1:0;
LL v1=(x&(1ll<<bit))?1:0;
ret=ret+(((u1&u2)^v1)<<bit);
}
return ret;
}
int main(){
ios::sync_with_stdio(false);
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
for(int i=1;i<=n;i++){
LL produce=check(a[i]);
if(mp[produce]){
cout<<i<<" "<<mp[produce]<<"\n";
return 0;
}
mp[a[i]]=i;
}
cout<<"-1"<<"\n";
}