#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; template using V = vector; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } const long long INF = 1LL << 60; const double pi=acos(-1); using ll = long long; using vll = V; using vvll = V>; using vpll =V>; using graph = V>; #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define bgn begin() #define en end() #define SORT(a) sort((a).bgn,(a).en) #define REV(a) reverse((a).bgn,(a).en) #define fi first #define se second #define gcd(a,b) __gcd(a,b) #define ALL(a) (a).begin(),(a).end() template std::vector make_vec(size_t n){ return std::vector(n); } template auto make_vec(size_t n, Args... args){ return std::vector(args...))>(n,make_vec(args...)); } const int MAX = 5100000; // change //const int MOD = 1000000007; const int MOD=998244353; long long fac[MAX], finv[MAX], inv[MAX]; void Comuse() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++){ fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } #define comuse Comuse() ll combi(int n, int k){ if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } ll perm(int n,int k){ if(n < k) return 0; if(n < 0 || k < 0) return 0; return fac[n] * (finv[k] % MOD) % MOD; } ll modpow(ll a,ll n,ll mod){ ll ans=1; while(n>0){ if(n&1){ ans=ans*a%mod; } a=a*a%mod; n/=2; } return ans; } ll POW(ll a,ll n){ ll ans=1; while(n>0){ if(n&1){ ans=ans*a; } a=a*a; n/=2; } return ans; } ll modinv(ll a, ll mod) { return modpow(a, mod - 2, mod); } ll modcombi(int n,int k,int mod){ ll ans=1; for(ll i=n;i>n-k;i--){ ans*=i; ans%=mod; } for(ll i=1;i<=k;i++){ ans*=modinv(i,mod); ans%=mod; } return ans; } vll div(ll n){ vll ret; for(ll i=1;i*i<=n;i++){ if(n%i==0){ ret.push_back(i); if(i*i!=n){ ret.push_back(n/i); } } } SORT(ret); return (ret); } const int era=2000000; long long sieve[era]; void Sieveuse(){ for(ll i=1;i>n; ll pos=n; while(true){ if(isprime(pos)){ break; } else{ pos--; } } vll A(n+1); FOR(i,2,n+1){ vll X(0); if(i==pos){ continue; } ll now=i; while(now>1){ X.push_back(sieve[now]); now/=sieve[now]; } ll m=X.size(); ll cnt=1; FOR(j,1,m){ if(X[j-1]==X[j]){ cnt++; } else{ ll x=X[j-1]; chmax(A[x],cnt); cnt=1; } } chmax(A[X[m-1]],cnt); } ll ans=1; FOR(i,2,n+1){ ans*=modpow(i,A[i],MOD); ans%=MOD; } cout<