#include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair; const ll INF = (1LL << 61); ll mod = 998244353; bool prime(ll n) { if (n == 1)return true; for (ll i = 2; i * i <= n; i++) { if (n % i == 0)return false; } return true; } struct Sieve { int n; vector f, primes; // n以下の素数を列挙する Sieve(int n = 1) :n(n), f(n + 1) { f[0] = f[1] = -1; for (ll i = 2; i <= n; ++i) { if (f[i]) continue; primes.push_back(i); f[i] = i; for (ll j = i * i; j <= n; j += i) { if (!f[j]) f[j] = i; } } } // xが素数かどうか判定する bool isPrime(int x) { return f[x] == x; } // 素因数を全列挙 vector factorList(int x) { vector res; while (x != 1) { res.push_back(f[x]); x /= f[x]; } return res; } // ランレングス圧縮 vector

factor(int x) { vector fl = factorList(x); if (fl.size() == 0) return {}; vector

res(1, P(fl[0], 0)); for (int p : fl) { if (res.back().first == p) { res.back().second++; } else { res.emplace_back(p, 1); } } return res; } }; signed main() { ios::sync_with_stdio(false); cin.tie(0); ll N; cin >> N; mapmp; ll tmp = 0; for (int i = N; ; i--) { if (prime(i)) { tmp = i; break; } } Sieve s(1000010); vector now = s.primes; ll tmp2 = N; ll ans = 1; for (auto x : now) { if (x == tmp)continue; N = tmp2; N /= x; while (N != 0) { ans *= x; ans %= mod; N /= x; } } cout << ans << endl; return 0; }