Your task is to write a program that, for each given, prints the smallest first prime numbers.
The input is a sequence of natural numbers with .
For each , print a line with the first prime numbers, in increasing order, and separated by a comma.
Before reading any , do a sieve of Eratosthenes to precalculate the first 1000 prime numbers. Knowing that 7919 is the prime number 1000 could be useful.
Input
5 10 1 29
Output
2,3,5,7,11 2,3,5,7,11,13,17,19,23,29 2 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109