#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int i,m,M;
double k;
cin>>M;
for (m=2;m<=M;m++)
{
k=sqrt((double)m);
for (i=2;i<=k;i++)
if (m%i==0)break;
if (i<=k)
cout<<m<<" ";
}
return 0;
}
#include<cmath>
using namespace std;
int main()
{
int i,m,M;
double k;
cin>>M;
for (m=2;m<=M;m++)
{
k=sqrt((double)m);
for (i=2;i<=k;i++)
if (m%i==0)break;
if (i<=k)
cout<<m<<" ";
}
return 0;
}