Problem: There are n cities in Berland, each of them has a unique id — an integer from 1 to n, the capital is the one with id 1. Now there is a serious problem in Berland with roads — there are no roads.

That is why there was a decision to build n - 1 roads so that there will be exactly one simple path between each pair of cities.

In the construction plan t integers a1, a2, ..., at were stated, where t equals to the distance from the capital to the most distant city, concerning new roads. ai equals the number of cities which should be at the distance i from the capital. The distance between two cities is the number of roads one has to pass on the way from one city to another. 

Also, it was decided that among all the cities except the capital there should be exactly k cities with exactly one road going from each of them. Such cities are dead-ends and can't be economically attractive. In calculation of these cities the capital is not taken into consideration regardless of the number of roads from it. 

Your task is to offer a plan of road's construction which satisfies all the described conditions or to inform that it is impossible.

Input

The first line contains three positive numbers n, t and k (2 ≤ n ≤ 2·105, 1 ≤ t, k < n) — the distance to the most distant city from the capital and the number of cities which should be dead-ends (the capital in this number is not taken into consideration). 

The second line contains a sequence of t integers a1, a2, ..., at (1 ≤ ai < n), the i-th number is the number of cities which should be at the distance i from the capital. It is guaranteed that the sum of all the values ai equals n - 1.

Output

If it is impossible to built roads which satisfy all conditions, print -1.

Otherwise, in the first line print one integer n — the number of cities in Berland. In the each of the next n - 1 line print two integers — the ids of cities that are connected by a road. Each road should be printed exactly once. You can print the roads and the cities connected by a road in any order.

If there are multiple answers, print any of them. Remember that the capital has id 1.

Examples

Input

7 3 3
2 3 1


Output

7
1 3
2 1
2 6
2 4
7 4
3 5


Input

14 5 6
4 4 2 2 1


Output

14
3 1
1 4
11 6
1 2
10 13
6 10
10 12
14 12
8 4
5 1
3 7
2 6
5 9


Input

3 1 1
2


Output

-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long n, k, t;
long long num, x, y, flag = 1;
vector<long long> vec1;
vector<long long> vec2;
void funcJoin(long long n1, long long n2, long long s1, long long s2,
              long long l) {
  long long i, j;
  s1 = s1 + l;
  long long s3 = (s2 + n2);
  i = s1;
  j = s2;
  while (i < (s2)) {
    vec1.push_back(i);
    vec2.push_back(j);
    i++;
    j++;
  }
  while (j < s3) {
    vec1.push_back(s1);
    vec2.push_back(j);
    j++;
  }
}
void search2(long long *arr, long long *max, long long *min, long long ind) {
  long long i, j;
  long long sind, s1, s2, s3, n1, n2, l, rm = num;
  s1 = 2;
  for (i = 1; i < ind; ++i) {
    n1 = arr[i];
    s2 = s1 + n1;
    n2 = arr[i + 1];
    l = max[i];
    rm -= l;
    funcJoin(n1, n2, s1, s2, l);
    s1 = s2;
  }
  sind = s1;
  s1 = s1 + arr[ind];
  for (i = ind + 1; i < t; ++i) {
    n1 = arr[i];
    s2 = s1 + n1;
    n2 = arr[i + 1];
    l = min[i];
    rm -= l;
    funcJoin(n1, n2, s1, s2, l);
    s1 = s2;
  }
  s1 = sind;
  n1 = arr[ind];
  s2 = s1 + n1;
  n2 = arr[ind + 1];
  l = rm;
  funcJoin(n1, n2, s1, s2, l);
}
void search1(long long *arr, long long *max, long long *min, long long ind) {
  long long i, j;
  long long sind, s1, s2, s3, n1, n2, l, rm = num;
  s1 = 2;
  for (i = 1; i < ind; ++i) {
    n1 = arr[i];
    s2 = s1 + n1;
    n2 = arr[i + 1];
    l = min[i];
    rm -= l;
    funcJoin(n1, n2, s1, s2, l);
    s1 = s2;
  }
  sind = s1;
  s1 = s1 + arr[ind];
  for (i = ind + 1; i < t; ++i) {
    n1 = arr[i];
    s2 = s1 + n1;
    n2 = arr[i + 1];
    l = max[i];
    rm -= l;
    funcJoin(n1, n2, s1, s2, l);
    s1 = s2;
  }
  s1 = sind;
  n1 = arr[ind];
  s2 = s1 + n1;
  n2 = arr[ind + 1];
  l = rm;
  funcJoin(n1, n2, s1, s2, l);
}
void initialise(long long *arr, long long *max, long long *min,
                pair<long long, long long> *fin,
                pair<long long, long long> *fin1) {
  long long i, j, l;
  for (i = 1; i < t; ++i) fin[i].first = 0, fin[i].second = 0;
  j = 0;
  for (i = 1; i < t; ++i) {
    fin[i].first += j;
    fin[i].second += j;
    j += min[i];
  }
  j = 0;
  for (i = t - 1; i > 0; --i) {
    fin[i].first += j;
    fin[i].second += j;
    j += max[i];
  }
  for (i = 1; i < t; ++i) {
    fin[i].first += max[i];
    fin[i].second += min[i];
  }
  for (i = 1; i < t; ++i) fin1[i].first = 0, fin1[i].second = 0;
  j = 0;
  for (i = 1; i < t; ++i) {
    fin1[i].first += j;
    fin1[i].second += j;
    j += max[i];
  }
  j = 0;
  for (i = t - 1; i > 0; --i) {
    fin1[i].first += j;
    fin1[i].second += j;
    j += min[i];
  }
  for (i = 1; i < t; ++i) {
    fin1[i].first += max[i];
    fin1[i].second += min[i];
  }
}
int main() {
  long long i, j, l;
  cin >> n >> t >> k;
  long long num_cities = n;
  long long arr[t + 1];
  pair<long long, long long> fin[t];
  pair<long long, long long> fin1[t];
  long long max[t];
  long long min[t];
  arr[0] = 1;
  for (i = 1; i <= t; ++i) cin >> arr[i];
  long long istp = 2;
  for (i = 0; i < arr[1]; ++i) {
    vec1.push_back(1);
    vec2.push_back(istp);
    istp++;
  }
  for (i = 1; i < t; ++i) {
    x = arr[i];
    y = arr[i + 1];
    if (x > y)
      min[i] = x - y;
    else
      min[i] = 0;
    max[i] = x - 1;
  }
  num = k - arr[t];
  if (num < 0)
    flag = 1;
  else if (num == 0) {
    long long s1 = 2, s2, n1, n2, s3;
    for (i = 1; i < t; ++i) {
      n1 = arr[i];
      s2 = s1 + n1;
      n2 = arr[i + 1];
      if (min[i] != 0) {
        flag = 1;
        break;
      }
      l = min[i];
      funcJoin(n1, n2, s1, s2, l);
      s1 = s2;
    }
    flag = 0;
  } else {
    initialise(arr, max, min, fin, fin1);
    if (flag == 1) {
      for (i = 1; i < t; ++i)
        if (num >= fin[i].second && num <= fin[i].first) {
          flag = 0;
          search1(arr, max, min, i);
          break;
        }
    }
    if (flag == 1) {
      for (i = 1; i < t; ++i)
        if (num >= fin1[i].second && num <= fin1[i].first) {
          flag = 0;
          search2(arr, max, min, i);
          break;
        }
    }
  }
  if (flag == 1)
    cout << -1 << endl;
  else {
    cout << num_cities << endl;
    for (i = 0; i < vec1.size(); ++i) cout << vec1[i] << " " << vec2[i] << endl;
  }
  return 0;
}