
#include<iostream>
using namespace std;
int sushu[1000010];
int n;
bool isPrime(int a){
	if (sushu[a] != -1){
		return sushu[a] == 0 ? false : true;
	}
	int i;
	for (i = 2; i < a; ++i){
		if (a%i == 0){
			sushu[a] = 0;
			return false;
		}
	}
	sushu[a] = 1;
	return true;
}
int main()
{
	memset(sushu, -1, sizeof(sushu));
	while (cin >> n){
		for (int i = 2; i <= n; ++i){
			if (isPrime(i))
				cout << i << endl;
		}
	}
	return 0;
}