using System;
public class Program
{
public static void Main()
int i,j;
int n = Convert.ToInt32(Console.ReadLine());
for(i = 2; i <= n; i++){
for(j = 2; j <= i;j++){
if(i%j==0)
break;
}
if(i == j)
Console.Write(i+ " ");