#include<bits/stdc++.h>
#include<bits/extc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
template<typename TH> void _dbg(const char* sdbg, TH h) { cerr<<sdbg<<"="<<h<<"\n"; }
template<typename TH, typename... TA> void _dbg(const char* sdbg, TH h, TA... t){
	while(*sdbg != ',') { cerr<<*sdbg++; } cerr<<"="<<h<<","; _dbg(sdbg+1, t...);
}
#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr<<#x<<": "; for(auto i:x) cerr<<i<<" "; cerr<<endl;}}
#define debugr(l,r,x) {{cerr<<#x<<": "; for(int i=l;i<=r;i++) cerr<<x<<" "; cerr<<endl;}}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define debugr(l,r,x)
#define cerr while(0) cerr
#endif
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//#define int long long
typedef __int128 INT;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define priority_queue std::priority_queue
#define F first
#define S second
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	vi v;
	for(int i=1; i<=10000; i++){
		if(i%3==0 || i%5==0 || i%7==0 || i%11==0) v.push_back(i);
	}
	debug(v.size());
	int n;
	cin>>n;
	for(int i=0; i<n-1; i++){
		cout<<v[i]*2<<" ";
	}
	cout<<1155<<endl;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<ll>>;
#define F(i,s,e) for(ll i=s;i<e;++i)
#define IA(array,size) F(i,0,size) cin >> array[i];
#define PA(array,size) F(i,0,size) cout << array[i] << " "; cout << endl;
constexpr int32_t MOD=1000000007;

int main(){
    ll n;
    cin >> n;
    ll p[n];
    IA(p,n);
    ll ans=0;
    bool ng[200010];
    F(i,0,200010){
        ng[i]=0;
    }
    F(i,0,n){
        ng[p[i]]=1;
        if(!ng[ans]){
            cout << ans << endl;
        }
        else{
            while(ng[ans]){
                ++ans;
            }
            cout << ans << endl;
        }
    }

    return 0;
}