using System;
namespace P3_12
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("һ:");
            int i,x, l;
            bool flag ;
            int.TryParse(Console.ReadLine(), out x);
            for (i = 2; i <= x; i++)
            {
                flag = true;
                for (l = 2; l <= Convert.ToInt32(Math.Sqrt(i)); l++)
                {
                    if (i % l == 0)
                    {
                        flag = false;
                        break;
                    }
                }
                if (flag)
                    Console.Write("{0}  ", i);
            }
            Console.ReadLine();
        }
    }
}
