Given are an integer K and integers a_1,\dots, a_K. Determine whether a sequence P satisfying below exists. If it exists, find the lexicographically smallest such sequence.

* Every term in P is an integer between 1 and K (inclusive).
* For each i=1,\dots, K, P contains a_i occurrences of i.
* For each term in P, there is a contiguous subsequence of length K that contains that term and is a permutation of 1,\dots, K.

Constraints

* 1 \leq K \leq 100
* 1 \leq a_i \leq 1000 \quad (1\leq i\leq K)
* a_1 + \dots + a_K\leq 1000
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


K
a_1 a_2 \dots a_K


Output

If there is no sequence satisfying the conditions, print `-1`. Otherwise, print the lexicographically smallest sequence satisfying the conditions.

Examples

Input

3
2 4 3


Output

2 1 3 2 2 3 1 2 3


Input

4
3 2 3 2


Output

1 2 3 4 1 3 1 2 4 3


Input

5
3 1 4 1 5


Output

-1
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map> 
#define fr first
#include<algorithm>
#include<vector>
#define sc second
using namespace std;
const int N=1100,inf=1e9;
int n,k,a[N],ans[N],curlen;
typedef vector<int> vi;
void merge(int *x,int *y,int *z,int len1,int len2){
	int i=1,j=1,l=0;
	while(i<=len1&&j<=len2){if(x[i]<y[j])z[++l]=x[i++];else z[++l]=y[j++];}
	while(i<=len1)z[++l]=x[i++];
	while(j<=len2)z[++l]=y[j++];
}

int b[N], x[N], y[N], z[N], l1, l2, l3;bool vis[N];
vi solve_ext(int exlen){l1=l2=l3=0;
	for(int i=1;i<=k;i++)vis[i]=0,b[i]=a[i];
	for(int i=0;i<k-exlen;i++){
		//if(vis[ans[curlen-i]])return vi(1,k+1);
		vis[ans[curlen-i]]=1;
	}
	for(int i=1;i<=k;i++){if(!vis[i])b[i]--;if(b[i]<0)return vi(1,k+1);}
	int mn=inf,mx=0;
	for(int i=1;i<=k;i++)mn=min(mn,b[i]),mx=max(mx,b[i]);
	if(mn*2>=mx){
		vi ret;
		for(int i=1;i<=k;i++)if(!vis[i])ret.push_back(i);
		return ret;
	}else if(mn*2+1==mx){
		vi res;
		for(int i=1;i<=k;i++)if(!vis[i]&&b[i]==mx)x[++l1]=i;
		for(int i=1;i<=k;i++)if(!vis[i]&&b[i]==mn)x[++l1]=i;
		for(int i=1;i<=k;i++)if(!vis[i]&&b[i]!=mx && b[i]!=mn)y[++l2]=i;
		merge(x,y,z,l1,l2);l3=l1+l2;
		res=vector<int>(z+1,z+l3+1);
		int p1=0,p2=0;
		for(int i=curlen-(k-exlen-1);i<=curlen;i++){
			if(b[ans[i]]==mx)p1=i;
			if(b[ans[i]]==mn&&!p2)p2=i;
		}
		for(int i=1;i<=l3;i++){
			if(b[z[i]]==mx)p1=i+curlen;
			if(b[z[i]]==mn&&!p2)p2=i+curlen;
		}
		if(p1<p2)return res;
		else return vector<int>(1,k+1);
	}else
		return vector<int>(1,k+1);			
}
bool bigger(vi a,vi b){
	for(int i=0;i<a.size();i++){
		if(i>=b.size())return 1;
		if(a[i]>b[i])return 1;if(a[i]<b[i])return 0;
	}
	return 0;
}
void extend(){vi ext(1,k+1);
	for(int exlen=1;exlen<=k&&exlen+curlen<=n;exlen++){
		int need=k-exlen;
		if(curlen-need+1>0){
			vi nw=solve_ext(exlen);
			if(bigger(ext,nw))ext=nw;
		}
	}
	for(int i=0;i<ext.size();i++)
		printf("%d ",ext[i]),ans[++curlen]=ext[i],a[ext[i]]--;
}
bool check(){
	int mn=inf,mx=0;
	for(int i=1;i<=k;i++)mx=max(mx,a[i]),mn=min(mn,a[i]);
	return mn*2>=mx;	
}
int main(){//freopen("a.in","r",stdin);
	scanf("%d",&k);
	for(int i=1;i<=k;i++)scanf("%d",&a[i]),n+=a[i];
	if(!check()){puts("-1");return 0;}
	while(curlen<n)extend();
	
}