#include<bits/stdc++.h>
using namespace std;
const int N=2e5+3;
int n,siz[N];
bool b[N];
struct syzs{
	int val,num;
} a[N];
struct ans{
	int e1,e2;
	bool operator <(const ans &emm) const{
	    if(emm.e1==e1) return e2>emm.e2;
		return emm.e1<e1;
	}
};
bool cmp(syzs c,syzs b){
	return c.val>b.val;
}
int find(int k){
	for(int i=1;i<=n;i++){
		if(a[i].val==a[k].val+2*siz[k]-n&&i!=k) return i;
	}
	return -1;
}
int main(){
	priority_queue <ans> q;
	cin>>n;
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i].val);
		a[i].num=i;
		siz[i]=1;
	}
	sort(a+1,a+n+1,cmp);
	b[1]=1;
	for(int i=1;i<=n;i++){
		int v=find(i);
		if(v==-1){
			if(i!=n) puts("-1"),exit(0);
			else continue;
		}
		siz[v]+=siz[i];
		q.push((ans) {min(a[v].num,a[i].num),max(a[v].num,a[i].num)});
	}
	while(!q.empty()){
		int v1=q.top().e1,v2=q.top().e2;
    	q.pop();
    	printf("%d %d\n",v1,v2);
	}
}