{"raw_statement":[{"iden":"problem statement","content":"Given are a sequence of $N$ integers $A=(A_1,A_2,\\cdots,A_N)$ and an integer $K$.\nConsider making a sequence of integers $x$ that satisfies both of the following conditions.\n\n*   For each integer $i$ ($1 \\leq i \\leq N$), $x$ contains exactly $A_i$ occurrences of $i$. $x$ does not contain other integers.\n*   For every way of choosing $K$ consecutive elements from $x$, their values are all distinct.\n\nDetermine whether it is possible to make $x$ that satisfies the conditions. If it is possible, find the lexicographically smallest such $x$."},{"iden":"constraints","content":"*   $2 \\leq K \\leq N \\leq 500$\n*   $1 \\leq A_i$\n*   $\\sum_{1 \\leq i \\leq N} A_i \\leq 200000$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$\n$A_1$ $A_2$ $\\cdots$ $A_N$"},{"iden":"sample input 1","content":"3 3\n2 2 1"},{"iden":"sample output 1","content":"1 2 3 1 2\n\nTwo sequences $x=(1,2,3,1,2),(2,1,3,2,1)$ satisfy the conditions. The lexicographically smaller one, $(1,2,3,1,2)$, is the answer."},{"iden":"sample input 2","content":"3 2\n2 1 2"},{"iden":"sample output 2","content":"1 2 3 1 3"},{"iden":"sample input 3","content":"3 3\n1 3 3"},{"iden":"sample output 3","content":"\\-1"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}