#include <iostream>
#include <math.h>
#include <fstream>
using namespace std;
int main()
{
    ifstream f1; f1.open("dnton.inp");
    long int n,a,b,c;
    f1>>n;
    ofstream f2; f2.open("dnton.out");
    if(n==3) {f2<<'2';}
    if(n>=4)
    {f2<<'2'<<endl<<'3'<<endl;
    for(a=5;a<n;a++)
        {c=0;
        for(b=2;b<=sqrt(a);b++)
        if(a%b==0){c=1;break;}
    if(c==0)f2<<a<<endl;}
    f2.close();
}}
