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

public class yandex_q2_D {

    public void solve() throws Exception {
        int n=nextInt(), m=nextInt();
        Album[] a = new Album[m];
        for (int i=0; i<m; i++) a[i] = new Album(nextInt(), i+1);
        Arrays.sort(a);
        
        int left=n, pos=0;
        boolean stop = false;
        int[] res = new int[n];
        for (Album alb: a) {
            while (alb.cnt-->0) {
                if (res[(pos+1)%n]==alb.pos || res[(pos+1)%n]==alb.pos) break;
                res[pos] = alb.pos;
                pos+=2;
                if (pos>=n) pos=1;
                left--;
                if (left==0) {stop=true; break;}
            }
            if (stop) break;
        }
        
        if (left==0) printlnArr(res);
        else println(-1);
    }
    
    class Album implements Comparable<Album> {
        int cnt, pos;
        public Album(int c, int p) {
            cnt=c; pos=p;
        }
        public int compareTo(Album o) {
            return o.cnt-cnt;
        }
    }



    ////////////////////////////////////////////////////////////////////////////    

    double EPS = 1e-7;
    int INF = Integer.MAX_VALUE;
    long INFL = Long.MAX_VALUE;
    double INFD = Double.MAX_VALUE;

    int[] dx = {0,1,0,-1};
    int[] dy = {-1,0,1,0};
    int[] dx8 = {0,1,1,1,0,-1,-1,-1};
    int[] dy8 = {-1,-1,0,1,1,1,0,-1};
    int[] knightMovesX = {1,2,2,1,-1,-2,-2,-1};
    int[] knightMovesY = {-2,-1,1,2,2,1,-1,-2};

    class Point {
        int x,y;
        public Point(int xx, int yy) {
            x=xx; y=yy;
        }
        public double dist(Point p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointL {
        long x,y;
        public PointL(long xx, long yy) {
            x=xx; y=yy;
        }
        public double dist(PointL p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    class PointD {
        double x,y;
        public PointD(double xx, double yy) {
            x=xx; y=yy;
        }
        public double dist(PointD p) {
            return sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
        }
    }
    double dist(int x, int y, int xx, int yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(long x, long y, long xx, long yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }
    double dist(double x, double y, double xx, double yy) {
        return sqrt((xx-x)*(xx-x)+(yy-y)*(yy-y));
    }


    @SuppressWarnings("serial")
    class IncMap extends HashMap<Object, Integer> {
        boolean add(Object key) {
            Integer i = get(key);
            if (i!=null) {
                put(key, i+1);
                return false;
            } else {
                put(key, 1);
                return true;
            }
        }
    }


    int min(int... nums) {
        int r = INF;
        for (int i: nums)
            if (i<r) r = i;
        return r;
    }
    int max(int... nums) {
        int r = -INF;
        for (int i: nums)
            if (i>r) r = i;
        return r;
    }
    long minL(long... nums) {
        long r = INFL;
        for (long i: nums)
            if (i<r) r = i;
        return r;
    }
    long maxL(long... nums) {
        long r = -INFL;
        for (long i: nums)
            if (i>r) r = i;
        return r;
    }

    int digitSum(long i) {
        i = abs(i);
        int r = 0;
        while (i>0) {
            r+=i%10;
            i/=10;
        }
        return r;
    }
    long digitProd(long i) {
        if (i==0) return 0;
        i = abs(i);
        long r = 1;
        while (i>0) {
            r*=i%10;
            i/=10;
        }
        return r;
    }

    double log2(long i) {
        return log(i)/log(2);
    }
    double log2(double i) {
        return log(i)/log(2);
    }
    long binpow(int x, int n) {
        long r = 1;
        while (n>0) {
            if ((n&1)!=0) r*=x;
            x*=x;
            n>>=1;
        }
        return r;
    }


    int[] months = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    boolean isLeapYear(int y) {
        return y%4==0 && (y%400==0 || y%100!=0);
    }
    boolean isValidDate(int d, int m, int y) {
        if (isLeapYear(y) && m==2 && d==29) return true;
        return m>0 && m<=12 && d>0 && d<=months[d];
    }
    int[] nextDay(int d, int m, int y) {
        if (d>=months[m])
            if (m==2 && d==28 && isLeapYear(y)) d++;
            else {d=1; m++;}
        else
            d++;
        if (m==13) {d=1; m=1; y++;}
        return new int[] {d,m,y};
    }


    long timer = System.currentTimeMillis();
    void startTimer() {
        timer = System.currentTimeMillis();
    }
    void stopTimer() {
        System.err.println("time: "+(System.currentTimeMillis()-timer)/1000.0);
    }


    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));

    String nextLine() throws IOException {
        return in.readLine();
    }
    String nextWord() throws IOException {
        StringBuilder sb = new StringBuilder();
        int c = 0;
        while (c<=' ') c=in.read();
        while (c>' ') {
            sb.append((char)c);
            c = in.read();
        }
        return sb.toString();
    }
    int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextWord());
    }
    long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextWord());
    }
    double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextWord());
    }

    void print(Object o) throws IOException {
        out.write(o.toString());
    }
    void println(Object o) throws IOException {
        out.write(o.toString());
        out.newLine();
    }
    void print(Object... o) throws IOException {
        if (o.length>0) out.write(o[0].toString());
        for (int i=1; i<o.length; i++)
            out.write(" "+o[i].toString());
    }
    void println(Object... o) throws IOException {
        print(o);
        out.newLine();
    }
    void printArr(int[] arr) throws IOException {
        if (arr.length>0) print(arr[0]);
        for (int i=1; i<arr.length; i++)
            out.write(" "+arr[i]);
    }
    void printArr(long[] arr) throws IOException {
        if (arr.length>0) print(arr[0]);
        for (int i=1; i<arr.length; i++)
            out.write(" "+arr[i]);
    }
    void printArr(double[] arr) throws IOException {
        if (arr.length>0) print(arr[0]);
        for (int i=1; i<arr.length; i++)
            out.write(" "+arr[i]);
    }
    void printlnArr(int[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }
    void printlnArr(long[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }
    void printlnArr(double[] arr) throws IOException {
        printArr(arr);
        out.newLine();
    }

    void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static void main(String[] args) throws Exception {
        Locale.setDefault(Locale.US);
        new yandex_q2_D().solve();
        out.flush();
        out.close(); in.close();
    }
}