Problem: Polycarp loves not only to take pictures, but also to show his photos to friends. On his personal website he has recently installed a widget that can display n photos with the scroll option. At each moment of time the widget displays exactly one photograph with the option showing the previous/next one. From the first photo, you can switch to the second one or to the n-th one, from the second photo you can switch to the third one or to the first one, etc. Thus, navigation is performed in a cycle.

Polycarp's collection consists of m photo albums, the i-th album contains ai photos. Polycarp wants to choose n photos and put them on a new widget. To make watching the photos interesting to the visitors, he is going to post pictures so that no two photos from one album were neighboring (each photo will have exactly two neighbors, the first photo's neighbors are the second and the n-th one).

Help Polycarp compile a photo gallery. Select n photos from his collection and put them in such order that no two photos from one album went one after the other.

Input

The first line contains two integers n and m (3 ≤ n ≤ 1000, 1 ≤ m ≤ 40), where n is the number of photos on the widget, and m is the number of albums. The second line contains m integers a1, a2, ..., am (1 ≤ ai ≤ 1000), where ai is the number of photos in the i-th album.

Output

Print the single number -1 if there is no solution. Otherwise, print n numbers t1, t2, ..., tn, where ti represents the number of the album of the i-th picture in the widget. The albums are numbered from 1 in the order of their appearance in the input. If there are several solutions, print any of them.

Examples

Input

4 3
1 3 5


Output

3 1 3 2


Input

10 2
5 5


Output

2 1 2 1 2 1 2 1 2 1


Input

10 3
1 10 3


Output

-1

Solution (in JAVA):

Solution:
import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main().run();
				} catch (Throwable e) {
					e.printStackTrace();
					exit(999);
				}
			}
		}, "1", 1 << 23).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	int startind;
	int []ans;
	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		int n = nextInt();
		int m = nextInt();
		int z[] = new int[m];
		for(int i = 0; i < m; i++)
			z[i] = nextInt();
		
		gm r = new gm(m, z);
		
		ans = new int[n];
		fill(ans, 9);
//		System.err.println(startind);
		int i = 0;
		ex1: for(; i < n - 1; i++){
			r.Msort();
			int p = m;
			boolean f = true;
			do{
				p = r.getNext(p);
				if(p == -1 || r.m[p].count == 0){
					f = false;
					break ex1;
				}
			}while(i > 0 && r.m[p].ind == ans[i-1]);
			r.dec(p);
			if(i == 0 && f)
				startind = r.m[p].ind;
			if(f)
				ans[i] = r.m[p].ind;
			else
				break;
		}
		ex2: if(i == n - 1){
			r.Msort();
			int p = m;
			boolean f = true;
			do{
				p = r.getNext(p);
				if(p == -1 || r.m[p].count == 0){
					f = false;
					break ex2;
				}
			}while(r.m[p].ind == ans[i-1] || r.m[p].ind == ans[0]);
			r.dec(p);
			if(f)
				ans[i++] = r.m[p].ind;
		}
		if(i != n)
			out.println(-1);
		else
			for(int j = 0; j < n; j++){
				if(j != 0)
					out.print(" ");
				out.print(ans[j]+1);
			}
//		System.err.println(Arrays.toString(ans));
		
		in.close();
		out.close();
	}
	class gm{
		P m[];
		int c;
		gm(int cc, int x[]){
			c = cc;
			m = new P[c];
			for(int i = 0; i < c; i++)
				m[i] = new P(i, x[i]);
			sort(m);
		}
		void dec(int pos){
			m[pos].count--;
		}
		int getZ(int ind){
			return m[ind].count;
		}
		void Msort(){
			sort(m);
		}
		int getNext(int prev){
//			for(int i = 0; i < m.length; i++){
//				if(i != 0) System.err.print(" ");
//				System.err.print(m[i].count + " " + m[i].ind +" |");
//			}
//			System.err.println();
//			System.err.println(Arrays.toString(ans));
			return prev-1;
		}
	}
	class P implements Comparable<P>{
		int ind, count;
		P(int ii, int cc){
			ind = ii;
			count = cc;
		}
		public int compareTo(P e){
			if(count != e.count || (startind != ind && startind != e.ind))
				return count - e.count;
			return startind;
		}
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}
	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}