#include <iostream>
#include <fstream>
using namespace std;
int main()
{
    ifstream fi("dnton.inp");
    long long n;
    fi>>n;
    fi.close();
    ofstream fo("dnton.out");
    if(n>=2){fo<<2<<endl;}
        for(long long i=3;i<n;i=i+2)
        {
            int dem=1;
            for(long long j=2;j*j<=i;j++)
            if(i%j==0){dem=0;break;}
            if(dem==1){fo<<i<<endl;}
        }
    return 0;
}
