#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int>a;
map<int,int>m;
int main(){
    for(int i=0;i<=200005;i++) a.push_back(i);
    int x,n;cin>>n;
    while(n--){
        cin>>x;
        if(m[x]==0) {
            int pos = lower_bound(a.begin(), a.end(), x) - a.begin();
            a.erase(a.begin() + pos);
            m[x]=1;
        }
        cout<<a.front()<<endl;
    }
}



#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<int> x(n);
    vector<int> y(n);
    for(int i=0; i<n; i++){
        cin >> x[i] >> y[i];
    }
    bool flg=false;
    for(int i=0; i<n; i++){
        int a1 = x[i];
        int b1 = y[i];
        for(int j=0; j<n; j++){
            int a2 = x[j];
            int b2 = y[j];
            if(i != j){
                for(int k=0; k<n; k++){
                    if( j != k && i != k ){
                        int a3 = x[k];
                        int b3 = y[k];
                        int ad21 = a2-a1;
                        int bd21 = b2-b1;
                        int ad31 = a3-a1;
                        int bd31 = b3-b1;
                        if(ad21 == 0 && ad31 == 0){
                            if(a1 == a3){
                                //cout << "i,j,k = " << i << " " << j << " " << k <<endl;
                                cout << "Yes" << endl;
                                return 0;
                            }else{
                                continue;
                            }
                        }   
                        double tmp1 = (double) (b2-b1)/(a2-a1);
                        double tmp2 = (double) (b3-b1)/(a3-a1);
                        if(abs(tmp1 - tmp2) <= 1e-10){
                            //cout << "i,j,k = " << i << " " << j << " " << k <<endl;
                            //cout << tmp1 << " " << tmp2 << endl;
                            cout << "Yes" << endl;
                            return 0;
                        }
                    }
                }
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

