#include<bits/stdc++.h> usingnamespacestd; constint N = 2e5 + 5;
int n, c[N], a[N], res[N];
intlowbit(int x){ return x & (-x); }
voidadd(int x, int y){ while (x <= n) { c[x] += y; x += lowbit(x); } }
intquery(int x){ int sum = 0; while (x >= 1) { sum += c[x]; x -= lowbit(x); } return sum; }
intmain() { cin >> n; add(1, 1); for (int i = 2; i <= n; i++) { cin >> a[i]; add(i, 1); } for (int i = n; i >= 1; i--) { int l = 0, r = n + 1, mid; while (l + 1 < r) { mid = l + r >> 1; if (query(mid) < a[i] + 1) l = mid; else r = mid; } res[i] = r; add(r, -1); } for (int i = 1; i <= n; i++) cout << res[i] << endl; return0; }