use std::collections::HashMap; const MOD: usize = 998244353; fn power(base: usize, times: usize) -> usize { if times == 0 { return 1usize; } if times == 1 { return base; } let temp = power(base, times/2); temp * temp % MOD * power(base, times%2) % MOD } fn calc(n: usize) -> Vec> { let mut flgs = vec![true; n+1]; flgs[0] = false; flgs[1] = false; let mut ret = vec![HashMap::new(); n]; for i in 2..n { if !flgs[i] { continue; } for j in 1..=n/i { flgs[i*j] = false; if i * j == n { continue; } let mut target = i*j; let mut cnt = 0usize; while target % i == 0 { target /= i; cnt += 1; } ret[i*j].insert(i, cnt); } } ret } fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut factors = vec![0usize; n]; let mapping = calc(n); for i in 1..n { let left = i; let right = n-i; for (&prime, &cnt) in mapping[left].iter() { let cnt2 = *mapping[right].get(&prime).unwrap_or(&0usize); factors[prime] = factors[prime].max(cnt + cnt2); } for (&prime, &cnt) in mapping[right].iter() { let cnt2 = *mapping[left].get(&prime).unwrap_or(&0usize); factors[prime] = factors[prime].max(cnt + cnt2); } } let result = (0..n).filter(|&i| factors[i] > 0).map(|i| power(i, factors[i])).fold(1usize, |x, y| x*y%MOD); println!("{}", result); }