#include<iostream>
using namespace std;
#include <math.h>
void outPrime(int n)
{
int *numberAll = new int[n];
for(int i=1;i<n;i++)
numberAll[i] = i+1;
for(int m=1;m<sqrt(n);m++)
{
if(numberAll[m]!=0)
{
for(int p=m+1;p<n;p++)
{
if(numberAll[p]%numberAll[m]==0)
numberAll[p] = 0;
}
}
}
for(int q=1;q<n;q++)
{if(numberAll[q]!=0)
cout<<numberAll[q]<<endl;
}
}
int main()
{
outPrime(1000000);
return 0;
}