#include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define ss(s) scanf("%s",s)
#define pi(x) printf("%d\n",x)
#define pl(x) printf("%lld\n",x)
#define ps(s) printf("%s\n",s)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int> pii;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pl> vpl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
int mpow(int base, int exp);
void ipgraph(int m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================
vi A, inc;
//Input: Array A
//Output: inc[i] = max len K, such that
//1. A[i],A[i+1],...,A[i+K-1] represents 1,2,3,...K
//2. A[i]>=1, A[i+1] >= 2, .... , A[i+K-1] >= K
void build(vi &inc){
inc.clear();
int i, n = A.size();
fo(i, n) A[i] -= i, inc.pb(1);
int j = 0;
int lim = 1;
fo(i, n){
while(j<n and A[j] >= lim) j++;
inc[i] = j-i;
cout << inc[i] << " ";
lim--;
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int i,k,j,t,n;
cin >> n;
fo(i, n) cin >> k, A.pb(k);
build(inc);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgZ2MgZ2V0Y2hhcl91bmxvY2tlZAojZGVmaW5lIGZvKGksbikgZm9yKGk9MDtpPG47aSsrKQojZGVmaW5lIEZvKGksayxuKSBmb3IoaT1rO2s8bj9pP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