#include<cstdio>
#include<string>
#include<cstring>
#include<utility>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<algorithm>
#include<vector>
#include<iostream>
#define ll long long
#define pii pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define inf 0x7fffffff
using namespace std;
int a[100010];
pii b[100010],c[100010];
int main()
{
	int i,j,k,n,m,x,y,x1,n1;
	scanf("%d",&n);
	n1=n;
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		b[i].fi=a[i];
		b[i].se=i+1;
		c[i]=b[i];
	}
	sort(b,b+n);
	vector<int> cl;
	while(n>1)
	{
		x=n-1;
		i=2;
		k=0;
		cl.clear();
		while(x!=0&&k<n)
		{
			j=b[x].fi-n1+i;
			if(j<y)
			{
				printf("-1");
				return 0;
			}
			i+=2;
			x1=lower_bound(b,b+n,mp(j,0))-b;
			if(b[x1].fi!=j)
			{
				printf("-1");
				return 0;
			}
			cl.push_back(x);
			k++;
			x=x1;
		}
		if(k>=n)
		{
			printf("-1");
			return 0;
		}
		for(i=0;i<cl.size();i++)
		{
			b[cl[i]]=mp(0,0);
		}
		sort(b,b+n);
		reverse(b,b+n);
		reverse(b,b+n-k);
		n-=k;
	}
	n=n1;
	sort(c,c+n);
	while(n>1)
	{
		x=n-1;
		i=2;
		k=0;
		cl.clear();
		while(x!=0&&k<n)
		{
			j=c[x].fi-n1+i;
			i+=2;
			x1=lower_bound(c,c+n,mp(j,0))-c;
			printf("%d %d\n",c[x].se,c[x1].se);
			cl.push_back(x);
			k++;
			x=x1;
		}
		if(k>=n)
		{
			printf("-1");
			return 0;
		}
		for(i=0;i<cl.size();i++)
		{
			c[cl[i]]=mp(0,0);
		}
		sort(c,c+n);
		reverse(c,c+n);
		reverse(c,c+n-k);
		n-=k;
	}
	return 0;
}/*
7
10
15
13
18
11
14
19
*/