def primeset(N): #N以下の素数をsetで求める.エラトステネスの篩O(√Nlog(N)) lsx = [1]*(N+1) for i in range(2,int(-(-N**0.5//1))+1): if lsx[i] == 1: for j in range(i,N//i+1): lsx[j*i] = 0 setprime = set() for i in range(2,N+1): if lsx[i] == 1: setprime.add(i) return setprime def factorization_all_n(n):#n以下の自然数すべてをを素因数分解 lspn = [[] for i in range(n+1)] lsnum = [i for i in range(n+1)] lsp = list(primeset(n)) lsp.sort() for p in lsp: for j in range(1,n//p+1): cnt = 0 while lsnum[p*j]%p==0: lsnum[p*j] //= p cnt += 1 lspn[j*p].append((p,cnt)) return lspn def modPow(a,n,mod):#繰り返し二乗法 a**n % mod if n==0: return 1 if n==1: return a%mod if n & 1: return (a*modPow(a,n-1,mod)) % mod t = modPow(a,n>>1,mod) return (t*t)%mod import collections N = int(input()) mod = 998244353 keym = collections.Counter() lspn = factorization_all_n(N-1) for i in range(1,N): v = N-i a = collections.Counter() for p,cnt in lspn[i]: a[p] += cnt for p,cnt in lspn[v]: a[p] += cnt for p in a.keys(): keym[p] = max(keym[p],a[p]) ans = 1 for p,cnt in keym.items(): ans *= modPow(p, cnt, mod) ans %= mod print(ans)