{"raw_statement":[{"iden":"problem statement","content":"Consider doing the operation below on a sequence of $N$ positive integers $A = (A_1, A_2, \\ldots, A_N)$ to obtain a sequence $I = (i_1, i_2, \\ldots, i_K)$.\n\n*   For each $k = 1, 2, \\ldots, K$ in this order, do the following.\n    *   Choose an $i$ such that $A_i = \\min{A_1, A_2, \\ldots, A_N}$.\n    *   Let $i_k = i$.\n    *   Add $1$ to $A_i$.\n\nYou are given integers $N$, $K$, and a sequence $I$.\nDetermine whether there exists a sequence of positive integers $A$ for which it is possible to obtain $I$ from the operation. If it exists, find the lexicographically smallest such sequence."},{"iden":"constraints","content":"*   $1\\leq N, K\\leq 3\\times 10^5$\n*   $1\\leq i_k\\leq N$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$\n$i_1$ $i_2$ $\\ldots$ $i_K$"},{"iden":"sample input 1","content":"4 6\n1 1 4 4 2 1"},{"iden":"sample output 1","content":"1 3 3 2\n\nSome of the sequences for which it is possible to obtain $I = (1,1,4,4,2,1)$ from the operation are $(1, 3, 3, 2)$ and $(2, 4, 5, 3)$. The lexicographically smallest among them is $(1, 3, 3, 2)$."},{"iden":"sample input 2","content":"4 6\n2 2 2 2 2 2"},{"iden":"sample output 2","content":"6 1 6 6"},{"iden":"sample input 3","content":"4 6\n1 1 2 2 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}