#include <map>
#include <vector>
#include <algorithm>
#include <numeric>
#include <iostream>
using namespace std;
int main() {
    int n; cin >> n;
    long long d[n]; for (int i = 0; i < n; i++) cin >> d[i];
    int v[n];
    iota(v, v+n, 0);
    sort(v, v+n, [&d](int i, int j) { return d[i] > d[j]; });
    map<long long, int> vertex;
    for (int i = 0; i < n; i++) vertex[d[i]] = i;
    vector<pair<int, int> > ans;
    int sz[n];
    fill(sz, sz+n, 1);
    for (int p = 0; p < n-1; p++) {
        const int i = v[p];
        const long long dist = d[i] - n + 2 * sz[i];
        // cerr << i << " " << sz[i] << " " << d[i] << " " << dist << endl;
        if (d[i] == dist || vertex.find(dist) == vertex.end()) {
            cout << "-1\n";
            return 0;
        }
        int j = vertex[dist];
        sz[j] += sz[i];
        ans.push_back({j, i});
    }
    if (d[v[n-1]] == accumulate(sz, sz+n, 0LL) - sz[v[n-1]])
        for (auto [i, j] : ans) cout << i+1 << " " << j+1 << endl;
    else
        cout << "-1\n";
}
