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:
/*
 * Code Author: Akshay Miterani
 * DA-IICT
 */
import java.io.*;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;

public class Main {

	static double eps=(double)1e-6;
	static long mod=(int)1e9+7;
	private static final long INF = 1000000000_000000L;
	public static void main(String args[]) throws FileNotFoundException{
		InputReader in = new InputReader(System.in);
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		//----------My Code----------
		int n=in.nextInt();
		int t=in.nextInt();
		int k=in.nextInt();
		int a[]=new int[t];
		int max=0;
		for(int i=0;i<t;i++){
			a[i]=in.nextInt();
			max+=a[i]-1;
		}
		max+=1;
		int min=0;
		for(int i=1;i<t;i++){
			if(a[i]<a[i-1])
				min+=a[i-1]-a[i];
		}
		min+=a[t-1];
		//System.out.println(min+" "+max);
		if(k>max || k<min){
			out.println("-1");
		}
		else{
			ArrayList<Pair> edges=new ArrayList<>();
			ArrayList<ArrayList<Integer>> arr=new ArrayList<>();
			for(int i=0;i<=t+1;i++){
				arr.add(new ArrayList<Integer>());
			}
			int given=max;
			arr.get(1).add(1);
			int ptr=2;
			for(int level=2;level<=t+1;level++){
				for(int i=ptr;i<ptr+a[level-2];i++){
					arr.get(level).add(i);
				}
				ptr+=a[level-2];
				edges.add(new Pair(arr.get(level-1).get(0), arr.get(level).get(0)));
				int mypar=1;
				int mych=1;
				while(given>k && mypar<arr.get(level-1).size() && mych<arr.get(level).size()){
					edges.add(new Pair(arr.get(level-1).get(mypar), arr.get(level).get(mych)));
					mypar++;mych++;
					given--;
				}
				while(mych<arr.get(level).size()){
					edges.add(new Pair(arr.get(level-1).get(0), arr.get(level).get(mych)));
					mych++;
				}
			}
			if(edges.size()+1!=n){
				out.println("-1");
			}
			else{
				out.println(edges.size()+1);
				for(Pair p:edges){
					out.println(p.x+" "+p.y);
				}
			}
		}
		out.close();
		//---------------The End------------------
	}
	static class Pair implements Comparable<Pair>{
		int x;
		int y;

		Pair(int xx,int yy){
			x=xx;
			y=yy;
		}
		@Override
		public int compareTo(Pair o) {
			if(Long.compare(this.y, o.y)!=0)
				return Long.compare(this.y, o.y);
			else
				return Long.compare(this.x, o.x);
		}
	}
	static long modulo(long a,long b,long c) {
		long x=1;
		long y=a;
		while(b > 0){
			if(b%2 == 1){
				x=(x*y)%c;
			}
			y = (y*y)%c; // squaring the base
			b /= 2;
		}
		return  x%c;
	}
	public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public InputReader(InputStream inputstream) {
			reader = new BufferedReader(new InputStreamReader(inputstream));
			tokenizer = null;
		}
		public String nextLine(){
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
	}
}