시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 64 MB67595288.136%

문제

As you know, escape rooms became very popular since they allow you to play the role of a video game hero. One such room has the following quiz. You know that the locker password is a permutation of N numbers. A permutation of length N is a sequence of distinct positive integers, whose values are at most N. You got the following hint regarding the password - the length of the longest increasing subsequence starting at position i equals Ai. Therefore you want to find the password using these values. As there can be several possible permutations you want to find the lexicographically smallest one. Permutation P is lexicographically smaller than permutation Q if there is an index i such that Pi < Qi and Pj = Qj for all j < i. It is guaranteed that there is at least one possible permutation satisfying the above constraints. Can you open the door?

입력

The first line of the input contains one integer N (1 ≤ N ≤ 105).

The next line contains N space-separated integer Ai (1 ≤ Ai ≤ N).

It’s guaranteed that at least one possible permutation exists. 

출력

Print in one line the lexicographically smallest permutation that satisfies all the conditions.

예제 입력 1

4
1 2 2 1

예제 출력 1

4 2 1 3

예제 입력 2

1
1

예제 출력 2

1