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.*;


public class Main{

       static class Album implements Comparable<Album> {
        int color;
        int count;

        Album(int number, int count) {
            this.color = number;
            this.count = count;
        }

        public int compareTo(Album o) {
            return count < o.count ? -1 : count == o.count ? 0 : 1;
        }
    }

    static List<Integer> search(List<Album> list, int cycle) {

        Collections.sort(list);

        int sum = 0;
        for (Album album : list) {
            sum = sum + album.count;
        }

        int[] left = new int[sum];
        int[] right = new int[sum];

        int cl = 0;
        int cr = 0;

        List<Integer> answer = new ArrayList<Integer>();

        for (Album album : list) {
            if (cl <= cr) {
                for (int i = 0; i < album.count; i++) {
                    left[cl++] = album.color;
                }
            } else {
                for (int i = 0; i < album.count; i++) {
                    right[cr++] = album.color;
                }
            }
        }

        if (cycle > (cr + cl)) {
            return answer;
        }

        if (cr == 0 || cl == 0) {
            return answer;
        }

        int full = Math.min(cl, cr);
        int half = cycle / 2;

        if (half <= full) {
            for (int i = 0; i < half; i++) {
                answer.add(left[i]);
                answer.add(right[i]);
            }
            if (cycle % 2 == 0) {
                return answer;
            }
            if (cr >= half + 1) {
                for (int i = half; i < cr; i++) {
                    for (int j = 0; j < answer.size() - 1; j++) {
                        if (answer.get(j) != right[i] && answer.get(j + 1) != right[i]) {
                            answer.add(j + 1, right[i]);
                            return answer;
                        }
                    }
                    if (answer.get(answer.size() - 1) != right[i] && answer.get(0) != right[i]) {
                        answer.add(right[i]);
                        return answer;
                    }
                }
            }
            if (cl >= half + 1) {
                for (int i = half; i < cl; i++) {
                    for (int j = 0; j < answer.size() - 1; j++) {
                        if (answer.get(j) != left[i] && answer.get(j + 1) != left[i]) {
                            answer.add(j + 1, left[i]);
                            return answer;
                        }
                    }
                    if (answer.get(answer.size() - 1) != left[i] && answer.get(0) != left[i]) {
                        answer.add(left[i]);
                        return answer;
                    }
                }
            }

            return new ArrayList<Integer>();
        }

        for (int i = 0; i < full; i++) {
            answer.add(left[i]);
            answer.add(right[i]);
        }

        int last_color = cl > cr ? left[full] : right[full];
        int last_count = cycle - (full * 2);

        for (int i = 0; i < last_count; i++) {
            int flag = 0;
            for (int j = 0; j < answer.size() - 1; j++) {
                if (answer.get(j) != last_color && answer.get(j + 1) != last_color) {
                    answer.add(j + 1, last_color);
                    flag = 1;
                    break;
                }
            }
            if (flag == 0 && answer.get(answer.size() - 1) != last_color && answer.get(0) != last_color) {
                answer.add(last_color);
                flag = 1;
            }
            if (flag == 0) {
                return new ArrayList<Integer>();
            }
        }

        return answer;

    }

    static void process(InputStream is, OutputStream os) {
        Scanner sc = new Scanner(is);

        List<Album> list = new ArrayList<Album>();

        int cycle = sc.nextInt();

        int albCount = sc.nextInt();
        for (int i = 0; i < albCount; i++) {
            int cnt = sc.nextInt();
            list.add(new Album(i + 1, cnt));
        }

        List<Integer> result = search(list, cycle);

        PrintWriter pw = new PrintWriter(os);
        if (result.size() == 0) {
            pw.write("-1");
        } else {
            for (int i = 0; i < result.size(); i++) {
                if (i > 0) pw.write(" ");
                pw.write(Integer.toString(result.get(i)));
            }
        }
        pw.flush();
    }

    public static void main(String[] arg) {
        process(System.in, System.out);
    }

   

}