#include using namespace std; struct iofast_t { iofast_t() { ios::sync_with_stdio(false); cin.tie(nullptr); } } iofast; struct uns_t {} uns; template auto vec(Element init, Head arg, Args ...args) { if constexpr (sizeof...(Args) == 0) return std::vector(arg, init); else return std::vector(arg, vec(init, args...)); } template auto vec(uns_t, Head arg, Args ...args) { return vec(Element(), arg, args...); } template > T &chmin(T &l, T r, Compare &&f = less()) { return l = min(l, r, f); } template > T &chmax(T &l, T r, Compare &&f = less()) { return l = max(l, r, f); } #include using mint = atcoder::modint998244353; int main() { int n; cin >> n; auto sieve = vec(uns, n + 1); iota(begin(sieve), end(sieve), 0); for (int i = 2; i <= n / i; ++i) { if (sieve[i] != i) { continue; } for (int j = i * i; j <= n; j += i) { if (sieve[j] == j) { sieve[j] = i; } } } auto p = vec>(uns, n + 1, 0); for (int i = 2; i <= n; ++i) { auto &pf = p[i]; int x = i; while (x != 1) { int d = sieve[x]; int c = 0; while (x % d == 0) { ++c; x /= d; } pf.push_back({ d, c }); } } map f; for (int i = 1; i <= n - 1; ++i) { auto iter1 = begin(p[i]); auto iter2 = begin(p[n - i]); while (iter1 != end(p[i]) && iter2 != end(p[n - i])) { auto [a1, b1] = *iter1; auto [a2, b2] = *iter2; if (a1 < a2) { chmax(f[a1], b1); ++iter1; continue; } if (a1 > a2) { chmax(f[a2], b2); ++iter2; continue; } chmax(f[a1], b1 + b2); ++iter1; ++iter2; } while (iter1 != end(p[i])) { chmax(f[get<0>(*iter1)], get<1>(*iter1)); ++iter1; } while (iter2 != end(p[n - i])) { chmax(f[get<0>(*iter2)], get<1>(*iter2)); ++iter2; } } mint ans = 1; for (auto [a, b] : f) { ans *= mint(a).pow(b); } cout << ans.val() << endl; }