#include <iostream>
#include <cstdio>
using namespace std;

int main() {
	int n;

	freopen("prime.out", "w", stdout);	

	cin >> n;
	
	int i, j;
	bool isprime;
	for(i=2;i<=n;i++) {
		isprime = true;		
		j = 2;		
      // Prwti Lysi:
		//while( j < i && isprime == true ) {
      // Defteri Lysi (psaxmoume gia diairetes mexri tin tetragwniki riza):
		while( j*j <= i && isprime == true ) {
			if( i%j == 0 ) isprime = false;
			j++;	
		}
		
		if( isprime == true ) cout << i << '\n';
	}

	return 0;
}
