#include <cmath>
#include <iostream>
#include <vector>

int main() {
    int n;
    std::cin >> n;
    if (n < 0) {
        std::cout << "You are a bad person!\n";
        return 0;
    }
    std::vector<bool> values(n + 1, true);
    int root = sqrt(n);
    for (unsigned int i = 2; i <= root; i++) {
        if (values[i]) {
            std::cout << i << '\n';
            for (int j = i * i; j <= n; j += i) {
                values[j] = false;
            }
        }
    }
    for (int i = root + 1; i <= n; i++) {
        if (values[i]) {
            std::cout << i << '\n';
        }
    }
}
