#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
bool a[5001];
for(int i = 0; i<=n; i++)
{
a[i]=true;
}
for(int i = 0; i<=n; i++)
{
for(int j = 0; j<=n; j++)
{
if(j%i==0)
{
if(a[j]==true)
{
a[j]=false;
}
else
{
a[j]=true;
}
}
}
}
for(int i = 1; i<=n; i++)
{
if(a[i]==false)
{
cout<<i<<" ";
}
}
return 0;
}