#include <bits/stdc++.h>
using namespace std;
#define int              long long int
#define double           long double
#define print(a)         for(auto x : a) cout << x << " "; cout << endl


const int M = 1000000007;
const int N = 3e5+9;
const int INF = 2e9+1;
const int LINF = 2000000000000000001;

inline int power(int a, int b, int mod=M) {
    int x = 1;
    a %= mod;
    while (b) {
        if (b & 1) x = (x * a) % mod; 
        a = (a * a) % mod;
        b >>= 1;
    }
    return x;
}


//_ ***************************** START Below *******************************




vector<int> isPrime;


//* Basic : No multiplication Overflow 
void seive1(){
    isPrime.assign(N+1, 1);
    isPrime[0] = isPrime[1] = 0;
    
    for(int i = 2; i<=N; i++){
        if(isPrime[i] == 0) continue;
        
        for(int j=2*i; j<=N; j+=i){
            isPrime[j] = 0;
        }
    }
}



//* Time Optimized Seive : i*i ==> may overflow
void seive2(){
	
	isPrime.assign(N+1, 1);
	isPrime[0] = isPrime[1] = 0;
 
	for(int i = 2; i*i<=N; i++){
		if(isPrime[i] == 0) continue;
		
		for(int j=i*i; j<=N; j+=i){
			isPrime[j] = 0;
		}
	}
 
}



 
void consistency(int n){
	
	for(int i=1; i<=n ; i++){
		if(isPrime[i] ) cout << i << ", ";
	}cout << endl;
}
 



void solve() {
	
	static bool initialized = []() {
        seive1(); 
        return true;
    }();
	
	static int _ = (seive2(), 0);
	
	
	
	int n;
	cin >> n;
	
	consistency(n);

}





int32_t main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }

    return 0;
}