#include <iostream>
using namespace std;
int main()
{
// 如果当前的数字是质数,那么它的倍数一定不是质数
bool pre[1050] = {1, 1}; // false代表是质数
for (int i = 2; i < 1050; i++)
if (pre[i] == false)
for (int j = i * 2; j < 1050; j += i)
if (pre[j] == false)
pre[j] = true;
int n;
cin >> n;
for (int i = 2; i <= n; i++)
if (!pre[i])
cout << i << "\n";
return 0;
}