시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 665 414 335 65.815%

문제

1부터 N까지의 수들이 한 번씩 쓰인 수열이 있다. 그 수열에서 i 앞에 있는 수 들 중, i보다 큰 수들의 개수를 A[i]라고 정의하자. A[i]가 주어져 있을 때, 원래 수열을 구하는 프로그램을 작성하여라. 

입력

첫째 줄에 수열 원소의 개수 (1 ≤ N ≤100,000)이 주어진다. 그리고 두 번째 줄부터 N+1 번째 줄까지 차례로 A[i]가 주어진다.

출력

N개의 줄에 걸쳐서 수열을 출력한다. (i번째 줄에는 i번째 원소를 의미한다)

예제 입력 1

8
5
0
1
2
1
2
0
0

예제 출력 1

2
7
3
5
4
1
8
6
W3sicHJvYmxlbV9pZCI6IjE4NDkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyMWNcdWM1ZjQiLCJkZXNjcmlwdGlvbiI6IjxwPjFcdWJkODBcdWQxMzAgTlx1YWU0Y1x1YzljMFx1Yzc1OCBcdWMyMThcdWI0ZTRcdWM3NzQgXHVkNTVjIFx1YmM4OFx1YzUyOSBcdWM0ZjBcdWM3NzggXHVjMjE4XHVjNWY0XHVjNzc0IFx1Yzc4OFx1YjJlNC4gXHVhZGY4IFx1YzIxOFx1YzVmNFx1YzVkMFx1YzExYyBpIFx1YzU1ZVx1YzVkMCBcdWM3ODhcdWIyOTQgXHVjMjE4IFx1YjRlNCBcdWM5MTEsIGlcdWJjZjRcdWIyZTQgXHVkMDcwIFx1YzIxOFx1YjRlNFx1Yzc1OCBcdWFjMWNcdWMyMThcdWI5N2MgQVtpXVx1Yjc3Y1x1YWNlMCBcdWM4MTVcdWM3NThcdWQ1NThcdWM3OTAuIEFbaV1cdWFjMDAgXHVjOGZjXHVjNWI0XHVjODM4IFx1Yzc4OFx1Yzc0NCBcdWI1NGMsIFx1YzZkMFx1Yjc5OCBcdWMyMThcdWM1ZjRcdWM3NDQgXHVhZDZjXHVkNTU4XHViMjk0IFx1ZDUwNF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