def main(): import sys mod_val = 998244353 N = int(sys.stdin.readline().strip()) if N == 1: print(1) return # Sieve of Eratosthenes to find primes up to N sieve = [True] * (N + 1) sieve[0] = sieve[1] = False for i in range(2, int(N**0.5) + 1): if sieve[i]: for j in range(i*i, N+1, i): sieve[j] = False primes = [i for i, is_prime in enumerate(sieve) if is_prime] candidates = [] for p in primes: if p > N: continue # Find the maximum exponent e where p^e <= N e = 0 current = 1 while current * p <= N: current *= p e += 1 # Check if p^e * 2 > N if current * 2 > N: candidates.append(p) # Compute X mod mod_val x_mod = 1 for p in primes: # Find e_p again since we need to recompute (primes list is in order) e = 0 current = 1 while current * p <= N: current *= p e += 1 # Compute p^e mod mod_val x_mod = x_mod * pow(p, e, mod_val) % mod_val if not candidates: print(x_mod) return else: p_max = max(candidates) inv_p = pow(p_max, mod_val - 2, mod_val) ans = x_mod * inv_p % mod_val print(ans) if __name__ == '__main__': main()