#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <bitset>
using namespace std;
using ll = long long;
const int N = 1e5 + 100;
int n;
ll nums[N], tree[N], ans[N];
inline int lowbit(int x) {
return x & (-x);
}
inline void add(int x, int c) {
for (int i = x; i <= n; i += lowbit(i)) {
tree[i] += c;
}
}
inline int ask(int x) {
int sum = 0;
for (int i = x; i; i -= lowbit(i)) {
sum += tree[i];
}
return sum;
}
int main() {
ios::sync_with_stdio(false);
cin >> n;
for (int i = 2; i <= n; i++) cin >> nums[i];
// 初始化树状数组,表示每一个可用元素数量是1
for (int i = 1; i <= n; i++) add(i, 1);
// 倒着求,从后往前
for (int i = n; i; i--) {
int k = nums[i] + 1;
int l = 1, r = n;
while (l < r) {
int mid = l + r >> 1;
// 找到最小的比k大的r
if (ask(mid) >= k) r = mid;
else l = mid + 1;
}
add(r, -1); // 表示r已经被用掉了
ans[i] = r;
}
for (int i = 1; i <= n; i++) cout << ans[i]<<endl;
return 0;
}