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;
template <typename T>
T gcd(T a, T b) {
  return a ? gcd(b % a, a) : b;
}
template <typename T>
T lcm(T a, T b) {
  return (a / gcd(a, b)) * b;
}
string int_to_str_easy(long long n) {
  return n ? "" : int_to_str_easy(n / 10) + (char)('0' + n % 10);
}
template <typename T>
T sum(vector<T> v) {
  T ans = 0;
  for (T i : v) ans += i;
  return ans;
}
template <typename T>
bool is_prime_sqrt(T n) {
  if (n == 1) return false;
  T k = trunc(sqrt(n));
  for (T i = 2; i <= k; i++)
    if (n % i == 0) return false;
  return true;
}
bool is_down(char x) { return ('a' <= x && x <= 'z'); }
bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
bool is_digit(char x) { return ('0' <= x && x <= '9'); }
string follow(string s) {
  for (int i = 0; i < s.length(); i++)
    if (is_upper(s[i])) s[i] += 'a' - 'A';
  return s;
}
const long double pi = 3.141592653589793238462643383279;
const long double log23 = 1.58496250072115618145373894394781;
const long double eps = 1e-8;
const long double zero = 0;
const long long INF = 1e18;
const int COUT = 30;
const int prost = 239;
const long long prost64 = 239;
const int two = 2;
const long long sr = 31;
const long long MOD = 1000000007;
const int BIG = 1e9;
const int alf = 26;
const int MAX_N = 2 * 1e5 + 1;
const int MAX_M = 2001;
const int km = (1 << 18) - 1;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int bit_max = 32;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
void solve() {
  cout << "-1";
  exit(0);
}
int n, t, k, a[MAX_N];
bool used[MAX_N];
int main() {
  cin.sync_with_stdio(0);
  cin >> n >> t >> k;
  for (int i = 0; i < t; i++) cin >> a[i];
  int s = a[t - 1];
  for (int i = 0; i < t - 1; i++)
    if (a[i] > a[i + 1]) s += a[i] - a[i + 1];
  if (s > k) solve();
  if ((n - t) < k) solve();
  cout << n << "\n";
  for (int i = 0; i < a[0]; i++) cout << 1 << " " << i + 2 << "\n";
  int go = k - s;
  s = 1;
  for (int i = 0; i < t - 1; i++) {
    if (a[i + 1] < a[i]) {
      int d = a[i] - a[i + 1];
      for (int j = s + a[i] - d; j < s + a[i]; j++) used[j] = true;
    }
    s += a[i];
  }
  for (int i = s; i < n; i++) used[i] = true;
  s = 1;
  for (int i = 0; i < t - 1; i++) {
    for (int j = s + 1; j < s + a[i] && !used[j] && go != 0; j++)
      used[j] = true, go--;
    s += a[i];
  }
  s = 1;
  for (int i = 0; i < t - 1; i++) {
    vector<int> has;
    for (int j = s; j < a[i] + s; j++)
      if (!used[j]) has.push_back(j);
    vector<int> to;
    for (int j = s + a[i]; j < s + a[i] + a[i + 1]; j++) to.push_back(j);
    for (int j = 0; j < has.size(); j++)
      cout << has[j] + 1 << " " << to[j] + 1 << "\n";
    for (int j = 0; j < to.size() - has.size(); j++)
      cout << has[0] + 1 << " " << to[has.size() + j] + 1 << "\n";
    s += a[i];
  }
  return 0;
}