using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = NN; var dlist = new Dictionary[n - 1]; var mlist = GetMinPDivList(n); for (var i = 0; i < dlist.Length; ++i) { var p = PDiv(i + 1, mlist); dlist[i] = new Dictionary(); foreach (var pi in p) { if (dlist[i].ContainsKey(pi)) ++dlist[i][pi]; else dlist[i][pi] = 1; } } var ansd = new Dictionary(); for (var i = 0; i < dlist.Length; ++i) { var rev = dlist.Length - i - 1; if (rev < i) break; foreach (var kv in dlist[i]) { var val = kv.Value + (dlist[rev].ContainsKey(kv.Key) ? dlist[rev][kv.Key] : 0); if (ansd.ContainsKey(kv.Key)) ansd[kv.Key] = Math.Max(ansd[kv.Key], val); else ansd[kv.Key] = val; } foreach (var kv in dlist[rev]) { if (dlist[i].ContainsKey(kv.Key)) continue; if (ansd.ContainsKey(kv.Key)) ansd[kv.Key] = Math.Max(ansd[kv.Key], kv.Value); else ansd[kv.Key] = kv.Value; } } var ans = 1L; var mod = 998_244_353; foreach (var kv in ansd) { for (var i = 0; i < kv.Value; ++i) ans = ans * kv.Key % mod; } WriteLine(ans); } static int[] GetMinPDivList(int max) { var minPDivList = new int[max + 1]; for (var i = 0; i <= max; ++i) minPDivList[i] = i; for (var i = 2; i * i <= max; ++i) if (minPDivList[i] == i) { for (var j = i * i; j <= max; j += i) if (minPDivList[j] == j) { minPDivList[j] = i; } } return minPDivList; } static List PDiv(int n, int[] minPDivList) { var p = minPDivList[n]; if (n == p) { var dic = new List(); dic.Add(p); return dic; } else { var dic = PDiv(n / p, minPDivList); dic.Add(p); return dic; } } }