#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int maxn = 101010;
struct Node{
    int num;
    ll d;
    bool operator < (const Node &tx) const {
        return d < tx.d;
    }
}a[maxn];
int n, flag;
int siz[maxn];

queue<int> q[2];
vector<pair<int, int> > ans;

int main(){
    scanf("%d", &n);
    for(int i = 1; i <= n; i ++){
        scanf("%lld", &a[i].d);
        a[i].num = i;
    }

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

    q[a[1].d & 1].push(1);
    siz[a[1].num] = n - 1;
    int tem_flag = n & 1;
    
    for(int i = 2; i <= n; i ++){
        if(q[1 & (a[i].d ^ tem_flag)].empty()){
            printf("-1");
            return 0;
        }
        int tem_num = q[1 & (a[i].d ^ tem_flag)].front();

        ll diff = a[i].d - a[tem_num].d;
        int diff_siz = (n - diff) / 2;
        
        siz[a[i].num] = diff_siz - 1;
        siz[a[tem_num].num] -= diff_siz;

        if(diff_siz > 1)
            q[a[i].d & 1].push(i);
        ans.push_back(make_pair(a[i].num, a[tem_num].num));
        if(siz[a[tem_num].num] <= 0) q[1 & (a[i].d ^ tem_flag)].pop();
    }

    for(int i = 1; i <= n; i ++){
        if(siz[i]){
            printf("debug : %d\n", i);
            return 0;
        }
    }

    int siz = ans.size() - 1;
    for(int i = 0; i <= siz; i ++)
        printf("%d %d\n", ans[i].first, ans[i].second);

}