import java.util.Scanner; public class primeShaifa { public static void main(String[] args) { int n; Scanner cin = new Scanner(System.in); while (cin.hasNextInt()) { n = cin.nextInt(); int[] array = new int[n]; for (int i = 2; i < n; i++) { array[i] = i; } for (int i = 2; i < n; i++) { if (array[i] != 0) { int j, temp; temp = array[i]; for (j = 2 * temp; j < n; j = j + temp) { array[j] = 0; } System.out.print(array[i] + " "); } } } } }