#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
#define PB push_back
const long long int TOP=1e13;
const int N=1510;
struct bignum{
    int size;
    vector<long long int>val;
    void init(int n){
        val.clear();
        val.PB(n);
        pull();
        return ;
    }
    void pull(){
        int k=0;
        for(int i=0;i<val.size();i++){
            val[i]+=k;
            k=0;
            if(val[i]>=TOP){
                k=val[i]/TOP;
                val[i]%=TOP;
            }
        }
        if(k>0)val.PB(k);
        size=(int)val.size();
    }
    void out(){
        long long int now;
        reverse(val.begin(),val.end());
        printf("%lld",val[0]);
        for(int i=1;i<size;i++){
            now=TOP/10;
            while(val[i]<now){
                now/=10;
                printf("0");
            }
            printf("%lld",val[i]);
        }
        printf("\n");
        reverse(val.begin(),val.end());
        return ;
    }
    void operator *=(long long int n){
        for(int i=0;i<size;i++)val[i]*=n;
        pull();
        return ;
    }
    void operator +=(long long int n){
        val[0]+=n;
        pull();
        return ;
    }
};
int main(){
    int n,dp[N];
    bignum a;
    scanf("%d",&n);
    n++;
    a.init(2);
    for(int i=3;i<=N;i+=2){
        dp[i]=0;
        dp[i-1]=2;
    }
    for(int i=3;i<=n;i+=2)if(dp[i]==0){
        dp[i]=i;
        for(int j=i*i;j<=n;j+=(i<<1))dp[j]=i;
        a*=i;
    }
    a+=2;
    a.out();
    for(int i=2;i<=n;i++)printf("%d\n",dp[i]);
}
