#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using Tiib = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

void yes(){
    cout << "Yes" << endl;
}

void no (){
    cout << "No" << endl;
}

ll cel (ll a, ll b){
    if (a % b == 0) return a / b;
    else return a / b + 1;
}

ll gcds(ll a, ll b){
    ll c = a % b;
    while (c != 0){
        a = b;
        b = c;
        c = a % b;
    }
    return b;
}

// segment tree : node(monoid : (ll,+))
// ar[i] = count(i);
vector<ll> node;
int sz = 1;
// len node : sz = 2べき
void init(int n){
    while (sz < n) sz *= 2;
    node.resize(2 * sz - 1);
    rep(i,2 * sz - 1) node[i] = 1LL;
}
void initv(int n, vector<ll> vec){
    while (sz < n) sz *= 2;
    node.resize(2 * sz - 1);
    rep(i,n) node[i + sz - 1] = vec[i];
    rep(i,sz-n) node[sz - 1 + n + i] = 0LL;
    rep(i,sz-1) node[sz-2-i] = node[2*sz-3-2*i] + node[2*sz-2-2*i];
}
// update ar[a] -> x
void update(int a){
    a += sz - 1;
    node[a] = max(0LL, node[a]-1LL);
    while (a > 0){
        a = (a - 1) / 2;
        node[a] = node[2 * a + 1] + node[2 * a + 2];
    }
}
// query : min Nth, k : node番号, [l,r) : node[k]の区間
int query(int N, int k=0, int l=0, int r=sz){
    assert(N <= node[0]);
    if (sz-1 <= k) return k - sz + 1;
    if (N <= node[2*k+1]) return query(N,2*k+1,l,(l+r)/2);
    if (N > node[2*k+1]) return query(N-node[2*k+1],2*k+2,(l+r)/2,r);
}

int main(){
    int n; cin >> n;
    vector<int> ans(n);
    vector<ll> ar(202020,1LL);
    initv(202020,ar);
    rep(i,n){
        int a; cin >> a;
        update(a);
        int b = query(1,0,0,sz);
        ans[i] = b;
    }
    //cout << query(1,0,0,sz) << endl;
    rep(i,n) cout << ans[i] << endl; //cout << sz << endl; cout << node[sz-1] << endl;
    //cout << node[0] << endl; cout << node[sz] << endl;
}
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

int main() {
    int N; cin >> N;

    bool nums[(int)2e5 + 2] = {}; int cur = 0;
    REP(i, 0, N) {
        int p; cin >> p;
        nums[p] = true;
        while (nums[cur]) cur++;
        cout << cur << endl;
    }
    return 0;
}