#include #define rep(i, n) for (int i = 0; i < (n); ++i) #define fi first #define se second using std::cin; using std::cout; using std::max; using std::map; using std::vector; using ll = long long; using P = std::pair; const int N = 1000005; const int mod = 998244353; struct mint { ll x; mint(ll x=0):x((x%mod+mod)%mod){} mint operator-() const { return mint(-x);} mint& operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint& operator-=(const mint a) { if ((x += mod-a.x) >= mod) x -= mod; return *this; } mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { mint res(*this); return res+=a; } mint operator-(const mint a) const { mint res(*this); return res-=a; } mint operator*(const mint a) const { mint res(*this); return res*=a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t>>1); a *= a; if (t&1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod-2); } mint& operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res/=a; } }; // linear sieve vector ps, pf; void sieve(int mx) { pf.resize(mx + 1); rep(i, mx + 1) pf[i] = i; for (int i = 2; i <= mx; ++i) { if (pf[i] == i) ps.push_back(i); for (int j = 0; j < ps.size() and ps[j] <= pf[i]; ++j) { int x = ps[j] * i; if (x > mx) break; pf[x] = ps[j]; } } } int main() { sieve(1e6); int n; cin >> n; auto f = [&](int x, int y) { int cnt = 0; while (x % y == 0) { x /= y; cnt++; } return cnt; }; mint ans = 1; for (int i = 2; i < n; ++i) { if (pf[i] != i) continue; int mx = 0; for (int j = i; j < n; j += i) { mx = max(mx, f(j, i) + f(n - j, i)); } ans *= mint(i).pow(mx); } cout << ans.x << '\n'; return 0; }