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

/**
 * @author Alexey Safronov (safronov.aa@gmail.com)
 */
public class D {
	private InputReader in;
	private PrintWriter out;
	
	private int[] solver(int start, int[] albums, int N) {
		int[] result = new int[N];
		result[0] = start;
		int M = albums.length;
		albums[start - 1] -= 1;
		
		for(int i = 1; i < N; i++) {
			int left = i - 1;
			if(i - 1 < 0) {
				left += N;
			}
			
			int right = i + 1;
			if(i + 1 >= N) {
				right -= N;
			}
			
			int cant1 = -1;
			int cant2 = -1;
			
			if(result[left] != 0) {
				cant1 = result[left] - 1;
			}
			if(result[right] != 0) {
				cant2 = result[right] - 1;
			}
			
			int max = -1;
			
			for(int j = 0; j < M; j++) {
				if(albums[j] > 0 && j != cant1 && j != cant2) {
					if(max == -1 || albums[j] > albums[max]) {
						max = j;
					}
				}
			}
			
			if(max == -1) {
				result[0] = -1;
				break;
			}
			
			//out.println(i + " " + (max + 1) + " " + albums[max]);
			
			albums[max] -= 1;
			result[i] = max + 1;
		}
		
		return result;
	}

	private void solve() {
		int N = in.readInt();
		int M = in.readInt();
		
		int[][] albums = new int[M][M];
		for(int i = 0; i < M; i++) {
			albums[0][i] = in.readInt();
		}
		for(int i = 1; i < M; i++) {
			for(int j = 0; j < M; j++) {
				albums[i][j] = albums[0][j];
			}
		}
		
		int[] result = new int[N];
		for(int j = 0; j < M; j++) {
			result = solver(j + 1, albums[j], N);
			
			if(result[0] != -1) {
				break;
			}
		}
		
		if(result[0] == -1) {
			out.println(-1);
		} else {
			for(int i = 0; i < N; i++) {
				out.print(result[i]);
				
				if(i != N - 1) {
					out.print(" ");
				} else {
					out.print("\n");
				}
			}
		}
	}

	public static void main(String[] args) {
		new D().run();
	}

	private D() {
		try {
//			System.setIn(new FileInputStream("input.txt"));
//			System.setOut(new PrintStream(new FileOutputStream("output.txt")));
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
		in = new InputReader(System.in);
		out = new PrintWriter(System.out);
	}

	private void run() {
		long time = System.nanoTime();
		
		//int tests = in.readInt();
		//for(int test = 1; test <= tests; ++test)
			solve();
			
		System.err.println((System.nanoTime() - time) / 1e9 + " sec");
		exit();
	}

	private void exit() {
		out.close();
		System.exit(0);
	}

	private static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar, numChars;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int readInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long readLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuffer res = new StringBuffer();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private String readLine0() {
			StringBuffer buf = new StringBuffer();
			int c = read();
			while (c != '\n' && c != -1) {
				if (c != '\r')
					buf.appendCodePoint(c);
				c = read();
			}
			return buf.toString();
		}

		public String readLine() {
			String s = readLine0();
			while (s.trim().length() == 0)
				s = readLine0();
			return s;
		}

		public String readLine(boolean ignoreEmptyLines) {
			if (ignoreEmptyLines)
				return readLine();
			else
				return readLine0();
		}

		public BigInteger readBigInteger() {
			try {
				return new BigInteger(readString());
			} catch (NumberFormatException e) {
				throw new InputMismatchException();
			}
		}

		public char readCharacter() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			return (char) c;
		}

		public double readDouble() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, readInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') {
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) {
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, readInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}
	}
}