#include<bits/stdc++.h>

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const int64 infll = (1LL << 61) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename Data, typename T, typename F1, typename F2 >
struct ReRooting {

  struct Node {
    int to, rev;
    Data data;
  };

  vector< vector< Node > > g;
  vector< vector< T > > ldp, rdp;
  vector< int > lptr, rptr;
  const F1 f1;
  const F2 f2;
  const T ident;

  ReRooting(int n, const F1 &f1, const F2 &f2, const T &ident) :
      g(n), ldp(n), rdp(n), lptr(n), rptr(n), f1(f1), f2(f2), ident(ident) {}

  void add_edge(int u, int v, const Data &d) {
    g[u].emplace_back((Node) {v, (int) g[v].size(), d});
    g[v].emplace_back((Node) {u, (int) g[u].size() - 1, d});
  }

  T dfs(int idx, int par) {

    while(lptr[idx] != par && lptr[idx] < g[idx].size()) {
      auto &e = g[idx][lptr[idx]];
      ldp[idx][lptr[idx] + 1] = f1(ldp[idx][lptr[idx]], f2(dfs(e.to, e.rev), idx, e.to, e.data));
      ++lptr[idx];
    }
    while(rptr[idx] != par && rptr[idx] >= 0) {
      auto &e = g[idx][rptr[idx]];
      rdp[idx][rptr[idx]] = f1(rdp[idx][rptr[idx] + 1], f2(dfs(e.to, e.rev), idx, e.to, e.data));
      --rptr[idx];
    }
    if(par < 0) return rdp[idx][0];
    return f1(ldp[idx][par], rdp[idx][par + 1]);
  }

  vector< T > solve() {
    for(int i = 0; i < g.size(); i++) {
      ldp[i].assign(g[i].size() + 1, ident);
      rdp[i].assign(g[i].size() + 1, ident);
      lptr[i] = 0;
      rptr[i] = (int) g[i].size() - 1;
    }
    vector< T > ret;
    for(int i = 0; i < g.size(); i++) {
      ret.push_back(dfs(i, -1));
    }
    return ret;
  }
};

int main() {
  int N;
  cin >> N;
  set< pair< int64, int > > que;
  vector< int64 > d(N);
  for(int i = 0; i < N; i++) {
    cin >> d[i];
    que.emplace(d[i], i);
  }

  vector< int > par(N, -1), size(N, 1);
  while(que.size() >= 2) {
    auto p = *prev(que.end());
    que.erase(p);
    const int other = N - size[p.second];
    int64 latte = p.first + size[p.second] - other;

    auto it = que.lower_bound({latte, -1});
    if(it == que.end() || it->first != latte) {
      cout << -1 << endl;
      return 0;
    }
    size[it->second] += size[p.second];
    par[p.second] = it->second;
  }

  using pi = pair< int64, int >;
  auto f1 = [&](pi x, pi y) { return pi(x.first + y.first, x.second + y.second); };
  auto f2 = [](pi a, int from, int to, int d) { return pi(a.first + (a.second + 1), a.second + 1); };
  ReRooting< int, pi, decltype(f1), decltype(f2) > reroot(N, f1, f2, pi());
  for(int i = 0; i < N; i++) if(~par[i]) reroot.add_edge(i, par[i], 0);
  auto uku = reroot.solve();
  for(int i = 0; i < N; i++) {
    if(uku[i].first != d[i]) {
      cout << -1 << endl;
      return 0;
    }
  }


  for(int i = 0; i < N; i++) {
    if(~par[i]) cout << par[i] + 1 << " " << i + 1 << endl;
  }
}


Measured memory_bytes: 35440