#include <bits/stdc++.h>
using namespace std;

class DSU {
public:
    DSU(int n) : _n(n) {
        _fa = vector<int>(n, -1);
        _sz = vector<int>(n, 0);
    }
    void create(int x) {
        _fa[x] = x;
        _sz[x] = 1;
    }
    int find(int x) {
        if (_fa[x] == -1) return -1;
        if (_fa[x] == x) return x;
        return _fa[x] = find(_fa[x]);
    }
    bool merge(int x,int y) {
        if (x == -1 || y == -1) return false;
        int fx = find(x), fy = find(y);
        if (fx == -1 || fy == -1) return false;
        if (fx == fy) return false;
        _fa[fy] = _fa[fx];
        _sz[fx] += _sz[fy];
        return true;
    }
    int get_sz(int x) {
        return _sz[find(x)];
    }
private:
    int _n;
    vector<int> _fa, _sz;
};

const int N=200010;

int main()
{
    int n;
    scanf("%d",&n);
    DSU dsu(N);
    int pos=0;
    for (int i=0;i<n;i++) {
        int x;
        scanf("%d",&x);
        dsu.create(x);
        dsu.merge(x,x-1);
        dsu.merge(x,x+1);
        while (dsu.find(pos) != -1) ++pos;
        printf("%d\n", pos);
    }
    return 0;
}