// Slower C++ solution:
/*

Though leaves are many, the root is one;

Through all the lying days of my youth

I swayed my leaves and flowers in the sun,

Now may I wither into the truth.



- William Butler Yeats

*/

#include <iostream>

#include <algorithm>

#include <math.h>

#include <string.h>

#include <cstdio>

#include <vector>

#include <set>

#include <cassert>

#include <cstdlib>

#include <complex>

#include <cctype>

#include <cmath>

#include <ctime>

#include <deque>

#include <queue>

#include <stack>

#include <map>

#include <set>

#include <sstream>

#include <functional>

#include <iomanip>

#include <bitset>

//#include <windows.h>  //Should be deleted when using AtCoder&POJ

using namespace std;



#define ll long long

#define pii pair<int,int>

#define qi ios::sync_with_stdio(0)

/**==Info==

*Program:6

*Problem:Distance Sums

*Date:2019-7-12

*Algorithm:Orange Boy's Greedy and Sorting

*Stats:WA*/



bool debug=false;





template<typename T1,typename T2> ostream& operator<<(ostream& o,pair<T1,T2> p){

	o<<"{";

	o<<p.first<<","<<p.second;

	o<<"}";

	return o;

}



ll n;

ll d[100005];

map <ll,ll> m;

pair<ll,ll> p[100005];

ll sub[100005];

ll sz[100005];

vector <pair<ll,ll> >res;

 

 int fa[100005];

 

int getFa(int x){

	if(fa[x]==x){

		return x;

	}

	return fa[x]=getFa(fa[x]);

}

 

 

void Union(int a,int b){

	if(fa[a]==fa[b]){

		return;

	}

	fa[getFa(a)]=getFa(b);

}



ll dp[100005];



ll dis[100005];



vector<int> nei[100005];



int main()

{

	ios_base::sync_with_stdio(false);

	cin>>n;

	for(ll i=0;i<n;i++)

	{

		cin>>d[i];

		if(d[i]>n*(n-1)/2){

			cout<<-1;

			return 0;

		}

		m[d[i]]=i;

		p[i].first=d[i];

		p[i].second=i;

		sz[i]=1;

	}

	sort(p,p+n);

	reverse(p,p+n);

	memset(sub,-1,sizeof(sub));

	for(ll i=0;i<n-1;i++)

	{

		ll de=p[i].first;

		ll x=p[i].second;

		sub[x]=n-sz[x]*2;

		if(sub[x]==0){

			cout<<-1;

			return 0;	

		}

		if(m.find(de-sub[x])==m.end()){

			cout<<-1;

			return 0;

		}

		ll par=m[de-sub[x]];

		sz[par]+=sz[x];

		dp[par]+=dp[x]+sz[x];

		res.push_back(make_pair(x,par));

	}

	

	for(int i=0;i<n-1;i++){

		nei[res[i].first].push_back(res[i].second);

		nei[res[i].second].push_back(res[i].first);

	}

	

	queue<int> q;

	memset(dis,-1,sizeof(dis));

	q.push(p[n-1].second);

	dis[p[n-1].second]=0;

	

	while(!q.empty()){

		int last=q.front();

		q.pop();

		

		for(int to:nei[last]){

			if(dis[to]==-1){

				dis[to]=dis[last]+1;

				q.push(to);

			}

		}

	}

	

	ll sm=0;

	for(int i=0;i<n;i++){

		sm+=dis[i];

	}

	if(sm!=p[n-1].first){

		cout<<-1;

		return 0;

	}

	

	for(ll i=0;i<n-1;i++)

	{

		cout<<res[i].first+1<<" "<<res[i].second+1<<endl;

	}

	

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.605271621441994x):
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



#define int ll

 

struct node{

	ll w;

	int y;

}a[100050];

 

struct node2{

	int t, nxt;

}edge[200050];

 

struct node3{int fr, f;};

 

int head[100050], cnt, n, siz[100050], anss;

 

void add(int u, int v){

	edge[++cnt] = (node2){v, head[u]};

	head[u] = cnt;

}

 

bool cmp(node a, node b){return a.w<b.w;}

 

int find(int u){

	for(int i = u-1; i >= 1; i--)if(a[i].w - a[u].w == 2*siz[a[u].y] - n) return a[i].y;

	return -1;

}

 

void print(int u, int fa){

	queue<node3> q;

	q.push((node3){u, fa});

	while(!q.empty()){

		u = q.front().fr;

		int ff = q.front().f;

		q.pop();

		for(int i = head[u]; i; i = edge[i].nxt){

			int v = edge[i].t;

			printf("%d %d\n", u, v);

			q.push((node3){v, u});

		}

	}

}



void test(int u, int fa, int dep){

	anss+=dep;

	for(int i = head[u]; i; i = edge[i].nxt){

		int v = edge[i].t;

		if(v == fa) continue;

		test(v, u, dep+1);

	}

}



main(){

	scanf("%d", &n);

	for(int i = 1; i <= n; i++) {

		scanf("%lld", &a[i].w);

		a[i].y = i;

	}

	sort(a+1, a+n+1, cmp);

	int rt = a[1].y;

	for(int i = n; i >= 2; i--) {

		siz[a[i].y]++;

		int p = find(i);

		if(p == -1){

			printf("-1");

			return 0;

		}

		siz[p]+=siz[a[i].y];

		add(p, a[i].y);

	}

	test(rt, 0, 0);

	if(anss != a[1].w){

		printf("-1");

		return 0;

	}

	print(rt, 0);

}