typedef long long ll; typedef long double ld; #include using namespace std; #define int long long // modint template struct Fp { // inner value long long val; // constructor constexpr Fp() noexcept : val(0) { } constexpr Fp(long long v) noexcept : val(v % MOD) { if (val < 0) val += MOD; } constexpr long long get() const noexcept { return val; } constexpr int get_mod() const noexcept { return MOD; } // arithmetic operators constexpr Fp operator - () const noexcept { return val ? MOD - val : 0; } constexpr Fp operator + (const Fp &r) const noexcept { return Fp(*this) += r; } constexpr Fp operator - (const Fp &r) const noexcept { return Fp(*this) -= r; } constexpr Fp operator * (const Fp &r) const noexcept { return Fp(*this) *= r; } constexpr Fp operator / (const Fp &r) const noexcept { return Fp(*this) /= r; } constexpr Fp& operator += (const Fp &r) noexcept { val += r.val; if (val >= MOD) val -= MOD; return *this; } constexpr Fp& operator -= (const Fp &r) noexcept { val -= r.val; if (val < 0) val += MOD; return *this; } constexpr Fp& operator *= (const Fp &r) noexcept { val = val * r.val % MOD; return *this; } constexpr Fp& operator /= (const Fp &r) noexcept { long long a = r.val, b = MOD, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b, swap(a, b); u -= t * v, swap(u, v); } val = val * u % MOD; if (val < 0) val += MOD; return *this; } constexpr Fp pow(long long n) const noexcept { Fp res(1), mul(*this); while (n > 0) { if (n & 1) res *= mul; mul *= mul; n >>= 1; } return res; } constexpr Fp inv() const noexcept { Fp res(1), div(*this); return res / div; } // other operators constexpr bool operator == (const Fp &r) const noexcept { return this->val == r.val; } constexpr bool operator != (const Fp &r) const noexcept { return this->val != r.val; } friend constexpr istream& operator >> (istream &is, Fp &x) noexcept { is >> x.val; x.val %= MOD; if (x.val < 0) x.val += MOD; return is; } friend constexpr ostream& operator << (ostream &os, const Fp &x) noexcept { return os << x.val; } friend constexpr Fp modpow(const Fp &r, long long n) noexcept { return r.pow(n); } friend constexpr Fp modinv(const Fp &r) noexcept { return r.inv(); } }; struct Eratos { vector primes; vector isprime; vector mebius; vector min_factor; Eratos(int MAX) : primes(), isprime(MAX+1, true), mebius(MAX+1, 1), min_factor(MAX+1, -1) { isprime[0] = isprime[1] = false; min_factor[0] = 0, min_factor[1] = 1; for (int i = 2; i <= MAX; ++i) { if (!isprime[i]) continue; primes.push_back(i); mebius[i] = -1; min_factor[i] = i; for (int j = i*2; j <= MAX; j += i) { isprime[j] = false; if ((j / i) % i == 0) mebius[j] = 0; else mebius[j] = -mebius[j]; if (min_factor[j] == -1) min_factor[j] = i; } } } // prime factorization vector> prime_factors(int n) { vector > res; while (n != 1) { int prime = min_factor[n]; int exp = 0; while (min_factor[n] == prime) { ++exp; n /= prime; } res.push_back(make_pair(prime, exp)); } return res; } // enumerate divisors vector divisors(int n) { vector res({1}); auto pf = prime_factors(n); for (auto p : pf) { int n = (int)res.size(); for (int i = 0; i < n; ++i) { int v = 1; for (int j = 0; j < p.second; ++j) { v *= p.first; res.push_back(res[i] * v); } } } return res; } }; signed main(){ ll n; std::cin >> n; Eratos er(n+10); vector ans(n); vector sq; for (int i = 0; i < n; i++) { ans[i] = i+1; if((ll)sqrt(i)*(ll)sqrt(i)==i){ sq.push_back(i); } } ll ind = 1; for (int i = n-1; i >= 0; i--) { auto pfs = er.prime_factors(i+1); ll res = 1; for (auto e : pfs) { if(e.second%2==1)res *= e.first; } // std::cout << i+1<<" "<