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.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.sort;

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) {
		}
		
//		System.setIn(new FileInputStream("gen.txt"));
//		long tm1 = System.currentTimeMillis();
		
		new Main().run();
		
//		long tm2 = System.currentTimeMillis();
//		System.err.println((tm2 - tm1) + " ms");
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	int IT = 10777;
	Random rnd = new Random(777L);

	int N;
	int M;
	List<Item> items;
	
	int[] color;
	int[] used;
	
	
	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		
		N = nextInt();
		M = nextInt();
		items = new ArrayList<Main.Item>(M);
		
		for (int i = 0; i < M; i++)
			items.add(new Item(i + 1, nextInt()));
		
		int sum = 0;
		for (Item item : items)
			sum += item.cnt;
		
		if (sum < N) {
			out.println(-1);
			out.close();
			return;
		}
		
		color = new int [N];
		used = new int [N + 1];
		stack = new int [M];
		
		Collections.sort(items);
		for (int it = 0; it < IT; it++) {
			if (solve() || solve1()) {
				for (int i = 0; i < N; i++) {
					if (i > 0)
						out.print(' ');
					out.print(color[i]);
				}
				out.println();
				out.close();
				return;
			}
			Collections.shuffle(items);
		}
		
		Collections.sort(items, new CmpAsc());
		if (solve() || solve1()) {
			for (int i = 0; i < N; i++) {
				if (i > 0)
					out.print(' ');
				out.print(color[i]);
			}
			out.println();
			out.close();
			return;
		}
		
		out.println(-1);
		
		out.close();
	}
	
	int[] stack;
	
	boolean solve() {
		fill(color, 0);
		fill(used, 0);
		
		lp: for (int cell = 0; cell < N; cell++) {
			int lind = cell - 1 < 0 ? (cell + N - 1) : (cell - 1);
			int rind = cell + 1 < N ? (cell + 1) : (cell - N + 1);
			int left = color[lind];
			int right = color[rind];
			
			for (int i = 0; i < M; i++) {
				Item item = items.get(i);
				int icol = item.col;
				if (used[icol] < item.cnt && left != icol && right != icol) {
					used[icol]++;
					color[cell] = icol;
					continue lp;
				}
			}
			
			return false;
		}
		
		return true;
	}
	
	boolean solve1() {
		fill(color, 0);
		fill(used, 0);
		
		lp: for (int cell = 0; cell < N; cell++) {
			int lind = cell - 1 < 0 ? (cell + N - 1) : (cell - 1);
			int rind = cell + 1 < N ? (cell + 1) : (cell - N + 1);
			int left = color[lind];
			int right = color[rind];
			
			int sz = 0;
			for (int i = 0; i < M; i++) {
				Item item = items.get(i);
				int icol = item.col;
				if (used[icol] < item.cnt && left != icol && right != icol) {
					stack[sz++] = i;
				}
			}
			
			if (sz > 0) {
				int icol = items.get(stack[rnd.nextInt(sz)]).col;
				used[icol]++;
				color[cell] = icol;
				continue lp;
			} else {
				return false;
			}
		}
		
		return true;
	}

	class Item implements Comparable<Item> {
		int col;
		int cnt;
		
		Item(int num, int cnt) {
			this.col = num;
			this.cnt = cnt;
		}

		@Override
		public int compareTo(Item item) {
			return item.cnt - cnt;
		}
	}
	
	class CmpAsc implements Comparator<Item> {
		@Override
		public int compare(Item i1, Item i2) {
			return i1.cnt - i2.cnt;
		}
	}
	
	
	/*************************************************************** 
	 * Input 
	 **************************************************************/
	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;
	}
}