#define rep(i, l, r) for (auto i = (l); i < (r); i++) #define chmin(dest, src) if ((dest) > (src)) dest = (src) #define chmax(dest, src) if ((dest) < (src)) dest = (src) #include using namespace std; using ll = long long; const ll MOD = 998244353; // map prime_division(int n) { // map pd; // int i = 2; // while (i * i <= n) { // while (i % n == 0) { // pd[i]++; // n /= i; // } // i++; // } // if (n > 1) pd[n]++; // return pd; // } ll pow_mod(ll x, int e) { ll r = 1; while (e > 0) { if (e & 1) r = r * x % MOD; x = x * x % MOD; e >>= 1; } return r; } int main() { int N; cin >> N; vector lpf(N + 1); vector primes; rep (d, 2, N + 1) { if (!lpf[d]) { lpf[d] = d; primes.push_back(d); } for (int p : primes) { if (p * d > N || p > lpf[d]) break; lpf[p * d] = p; } } auto prime_division = [lpf](int n, map &pd) { while (n > 1) { int d = lpf[n]; n /= d; pd[d]++; } }; // vector> pds(N, map()); // rep (i, 1, N) { // prime_division(i, pds[i]); // } map lcm_pd; int half = (N - 1) / 2; rep (i, 1, N) { int j = N - i; map pd; // for (auto &e : pds[i]) pd[e.first] += e.second; // for (auto &e : pds[j]) pd[e.first] += e.second; // for (int p : pds[i]) pd[p]++; // for (int p : pds[j]) pd[p]++; prime_division(i, pd); prime_division(j, pd); if (i <= half) { for (auto &e : pd) chmax(lcm_pd[e.first], e.second * 2); } else { for (auto &e : pd) chmax(lcm_pd[e.first], e.second); } } ll ans = 1; for (auto &e : lcm_pd) { ans *= pow_mod(e.first, e.second); ans %= MOD; } if (ans < 0) ans += MOD; cout << ans << endl; return 0; }