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 JAVA):

Solution:
/**
 * Created by ankeet on 1/4/17.
 */
import java.io.*;
import java.util.*;

public class G746 {

    static FastReader in = null;
    static PrintWriter out = null;

    public static void solve()
    {
        int n = in.nextInt();
        int t = in.nextInt();
        int k = in.nextInt();

        int[] a = new int[t+1];
        for(int i = 1; i<=t; i++) a[i] = in.nextInt();

        int maxk = 0;
        int mink = 0;

        for(int i=1; i<t; i++) maxk += a[i] - 1;
        maxk += a[t];

        mink = a[t];
        for(int i = t-1; i>=1; i--){
            mink += Math.max(a[i] - a[i+1],0);
        }

        if(k < mink || k > maxk){
            out.println(-1);
            return;
        }

        int[] leaf = new int[t+1]; // how many leaf nodes at distance i, i > 0

        int sofar = 0;
        for(int i=1; i< t; i++){
            if(a[i] > a[i+1]) {
                leaf[i] = a[i] - a[i + 1];
                sofar += a[i] - a[i+1];
            }
        }
        sofar += a[t];
        leaf[t] = a[t]; // they all must be leaf nodes

        for(int i=1; i<t; i++){
            if(sofar < k){
                int canadd = Math.min(k - sofar, (a[i]-1) - leaf[i]);
                leaf[i] += canadd;
                sofar += canadd;
            }
        }

        //out.println(Arrays.toString(leaf));
        TreeSet<Pair> ts = new TreeSet<>();

        ArrayList<Integer>[] g = new ArrayList[t+1];
        for(int i=0; i<=t; i++) g[i] = new ArrayList<>();
        g[0].add(1);
        int ptr = 2;
        for(int i=1; i<=t; i++){
            if(i == 1){
                for(int j =1; j <= a[1]; j++){
                    g[i].add(ptr);
                    ts.add(new Pair(1, ptr));
                    ptr++;
                }
            }
            else{
                int u = 0;
                for(int j = 1; j <= a[i]; j++){
                    g[i].add(ptr);
                    ts.add(new Pair(g[i-1].get(u), ptr));
                    ptr++;

                    u++;
                    if(u == (a[i-1] - leaf[i-1])) u = 0;
                }
            }
        }

        out.println(n);
        for(Pair p: ts){
            out.printf("%d %d\n", p.f, p.s);
        }


    }
    static class Pair implements Comparable<Pair>{
        int f;
        int s;
        public Pair(int ff, int ss){
            f = ff;
            s = ss;
        }
        public int compareTo(Pair p){
            if(f != p.f) return f - p.f;
            return s - p.s;
        }
    }
    public static void main(String[] args)
    {
        in = new FastReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
        out.close();

    }

    static class FastReader {

        BufferedReader read;
        StringTokenizer tokenizer;

        public FastReader(InputStream in)
        {
            read = new BufferedReader(new InputStreamReader(in));
        }

        public String next()
        {
            while(tokenizer == null || !tokenizer.hasMoreTokens())
            {
                try{
                    tokenizer = new StringTokenizer(read.readLine());
                }catch(Exception e){
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public String nextLine(){

            try
            {
                return read.readLine();
            }
            catch(Exception e)
            {
                throw new RuntimeException(e);
            }
        }
        public int nextInt()
        {
            return Integer.parseInt(next());
        }
        public long nextLong()
        {
            return Long.parseLong(next());
        }
        public double nextDouble()
        {
            return Double.parseDouble(next());
        }

        public int[] nextIntArr(int n)
        {
            int[] a = new int[n];
            for(int i=0; i<n; ++i)
            {
                a[i] = nextInt();
            }
            return a;
        }

        public long[] nextLongArr(int n)
        {
            long[] a = new long[n];
            for(int i=0; i<n; ++i)
            {
                a[i] = nextLong();
            }
            return a;
        }
    }


}