# 키가 i 일 때
# 1. 왼쪽에 나보다 큰사람이 0인 경우 -> 리스트의 왼쪽부터 봤을때 가장 처음 0의 자리에 i를 넣는다.
# 2. 왼쪽에 나보다 큰사람이 j명인 경우 -> 리스트의 왼쪽부터 0 을 j만큼 지나친 이후의 0의 자리에 i를 넣는다.
n = int(input())
lines = list(map(int, input().split()))
res = [0] * n
cnt = 0
for i in range(n):
# 왼쪽에 나보다 큰 사람이 없는 경우
if lines[i] == 0:
for j in range(n):
if res[j] == 0:
res[j] = i+1
break
# 왼쪽에 나보다 큰 사람이 있는 경우
else:
# 큰 사람이 cnt만큼 있음
cnt = lines[i]
for j in range(n):
if res[j] == 0 and cnt != 0:
cnt -= 1
elif res[j] == 0 and cnt == 0:
res[j] = i+1
break
else:
continue
# print(*res)
print(*res)