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 java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Queue;
import java.util.Random;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Solution implements Runnable {

	public static void main(String[] args) {
		(new Thread(new Solution())).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String r = in.readLine();
			if (r == null) return null;
			st = new StringTokenizer(r);
		}
		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());
	}
	
	class Q {
		int c, n;
		Q(int a, int b) {
			c = a; n = b;
		}
	}
	
	int firstn;
	
	void solve() throws Exception {
		int n = nextInt(), m = nextInt();
		int[] a = new int[m];
		TreeSet<Q> ts = new TreeSet<Q>(new Comparator<Q>() {
			public int compare(Q o1, Q o2) {
				if (o1.c == o2.c) {
					if (o1.n == o2.n) return 0;
					if (o1.n == firstn) return -1;
					if (o2.n == firstn) return 1;
					return o1.n - o2.n; 
				} else return o2.c - o1.c;
			}
		});
		firstn = 0;
		for (int i = 0; i < m; i++) {
			a[i] = nextInt();
			if (a[i] > a[firstn]) firstn = i;
		}
		firstn++;
		for (int i = 0; i < m; i++) {
			ts.add(new Q(a[i], i + 1));
		}
		int[] ans = new int[n];
		int l = 0;
		int pa = -1;
		Stack<Q> fuck = new Stack<Q>();
		for (int i = 0; i < n; i++) {
			Q q = null;
			while (!ts.isEmpty()) {
				q = ts.pollFirst();
				if (q.n == pa || i == n - 1 && q.n == ans[0]) {
					fuck.add(q);
					q = null;
				} else break;
			}
			if (q == null) {
				l = 0;
				break;
			}
			q.c--;
			ans[l++] = q.n;
			if (q.c != 0) ts.add(q);
			while (!fuck.isEmpty()) ts.add(fuck.pop());
			pa = q.n;
		}
		if (l == 0) out.println("-1"); else {
			for (int i = 0; i < l; i++) out.print(ans[i] + " ");
		}
	}
	
	public void run() {
		Locale.setDefault(Locale.UK);
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
//			in = new BufferedReader(new FileReader("input.txt"));
//			out = new PrintWriter("output.txt");
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		} finally {
			out.flush();
		}
	}

}