#include <bits/stdc++.h> using namespace std ; /* this program is for finding the prime number till the given number */ void primeSieve ( long long n ) { long long prime [ n + 1 ] = { 0 }; for ( long long i = 2 ; i <= n ; i ++ ) { if ( prime [ i ] == 0 ) for ( long long j = i * i ; j <= n ; j += i ) { prime [ j ] = 1 ; } } for ( long long i = 2 ; i <= n ; i ++ ) { if ( prime [ i ] == 0 ) cout << i << " " ; } } int main () { long long n ; cin >> n ; primeSieve ( n ); return 0 ; }