#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
vector <int> tree (150001 , 0);
vector <int> players(30001);
vector <int> results(30001);
ifstream fin;
ofstream fout;
const int left_val = 1;
int right_val;
void update (int nod, int left, int right, int position, int value){
if(left == right){
tree[nod] = value;
return;
}
int half = (left + right) /2;
if (position <= half)
update ((2 *nod) , left, half, position, value);
else
update ((2*nod + 1) , half+1 , right, position , value);
tree[nod] = tree[2*nod] + tree[2*nod+1];
}
int query (int nod, int left, int right,int a,int b){
int to_return = -1;
if (left == a && right == b)
return tree[nod];
int half = (left + right) /2;
int val1=0, val2=0;
if (a <= half && b <= half) to_return = query ((2*nod) , left, half, a, b);
if (a <= half && b > half) {
val1 = query ((2*nod) , left, half , a, half);
val2 = query ((2*nod+1), half+1, right, half+1, b);
to_return = val1 + val2;
}
if (a> half && b> half) to_return = query ((2*nod+1), half+1 ,right, a, b);
return to_return;
}
int n, i;
int main (void){
int left_side, right_side, to_be_added, query_result;
bool first_time;
fin.open("schi.in");
fin>>n;
for (right_val = 1; right_val<n; right_val<<=1);
for (i=1; i<=n; i++)
fin>>players[i];
for (i=n; i>0; i--){
left_side = 1;
right_side = players[i];
query_result = 1;
first_time = true;
to_be_added = query(1, left_val, right_val, left_side, right_side);
if (to_be_added > 0)
while (query_result){
left_side = right_side + 1;
if (first_time){
right_side += to_be_added;
first_time = false;
}else right_side += query_result;
query_result = query(1, left_val, right_val, left_side, right_side);
to_be_added += query_result;
}
results[players[i] + to_be_added] = i;
update(1,left_val, right_val, players[i] + to_be_added, 1);
}
fout.open("schi.out");
for (i=1; i<=n; i++)
fout<<results[i]<<"\n";
// int testulet[10];
//
// testulet[1] = 1;
// testulet[2] = 3;
// testulet[3] = 5;
// testulet[4] = 7;
// testulet[5] = 9;
// testulet[6] = 11;
//
// for (i=1; i<=6; i++){
// update(1, left_val, 8, i, testulet[i]);
//
//
// }
//
// for (i=1; i<=6; i++)
// cout<<query(1, left_val, 8, 1, i)<<"\n";
return 0;
}