Minimum permutation
Given a natural number n and non-negative integers k_1, k_2, ..., k_n such that:
[ k_1 + 2k_2 + ...+ nk_n = n. ]
Your task is to construct the lexicographically smallest permutation of numbers from 1 to n, where the permutation's decomposition into non-overlapping cycles includes k_1 cycles of length 1, k_2 cycles of length 2, ..., and k_n cycles of length n. A permutation x=(x_1, x_2, ..., x_n) is considered lexicographically smaller than another permutation y=(y_1, y_2, ..., y_n) if there exists an index i in {1, 2, ..., n} such that x_j = y_j for all 1 ≤ j < i and x_i < y_i.
Input
The first line of the input contains a natural number n (1 ≤ n ≤ 10^5). The second line contains non-negative integers k_1, k_2, ..., k_n separated by spaces, satisfying the condition k_1 + 2k_2 + ...+ nk_n = n.
Output
Output a single line with n numbers separated by spaces: the elements of the desired permutation.