//#include <fstream>
//#include <iostream>
//
//using namespace std;
//
//ifstream in("invsc.in");
//ofstream out("invsc.out");
//
//const int DIM = 2e5 + 17;
//
//int H[DIM];
//int v[DIM];
//
//main()
//{
//
// int n;
// in >> n;
//
// for(int i = 1; i <= n; i++)
// {
// in >> v[i];
// H[v[i]]++;
//
//
// }
//
// for(int i = 2; i <= n; i++)
// H[i] += H[i - 1];
//
// for(int i = 1; i <= n; i++)
// {
// cout << H[v[i]] << '\n';
// H[v[i]]--;
// }
//}
#include <iostream>
#include <fstream>
#include <vector>
#include <functional>
using namespace std;
ifstream fin("invsc.in");
ofstream fout("invsc.out");
int n;
vector< pair<int, int> > v;
int main(){
int i, j, x;
fin >> n;
fin >> x;
v.push_back(make_pair(x, 1));
for(i = 1; i < n; i++){
fin >> x;
if(x <= v.back().first) v.back().second++;
else v.push_back(make_pair(x, 1));
}
for(i = 0, x = 0; i < v.size(); i++){
for(j = v[i].second; j > 0; j--) cout << x + j << '\n';
x += v[i].second;
}
}