Restore the permutation#1790

Restore the permutation

1 segundo
128 megabytes
Media (≈1350)

Given permutation . Let f_i be the number of such that p_j > p_i and j < i. The array is called the inversion table of permutation . Given the inversion table, restore the permutation.

Entrada

The first line contains the order (0 < n \le 2000) of the permutation . The second line contains the inversion table .

Salida

Print the restored permutation .

Ejemplos

Ejemplo 1

Loading
Loading