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

#define rep(i, n) for (int i = 0; i < (int)(n); ++ i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++ i)
#define foreach(itr, c) for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); ++ itr)

typedef long long LL;
typedef pair<int, int> pii;

int n;

int main()
{
    scanf("%d", &n);
    if (n == 3){
        printf("6 10 15\n");
        return 0;
    }
    for (int i = 1; i <= 10000; ++ i){
        if (n == 0) break;
        int cnt = 0;
        if (i % 2 == 0) cnt ++;
        if (i % 3 == 0) cnt ++;
        if (i % 5 == 0) cnt ++;
        if (cnt > 1) {
            printf("%d ", i);
            n --;
        }
    }

    printf("\n");
    
    return 0;
}
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define str to_string
#define endl "\n"
#define PI 3.141592653589
using namespace std;
using lint = long long;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

//AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC
int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int n,p=0,tmp;cin>>n;
    vector<int> vec(300000);
    for(int i=0;i<n;i++){
        cin>>tmp;
        vec[tmp]=1;
        while(true){
            if(vec[p])p++;
            else break;
        }
        cout<<p<<endl;
    }
}
