local mmi, mma = math.min, math.max local mfl, mce = math.floor, math.ceil local mod = 998244353 local function bmul(x, y) local x0, y0 = x % 31596, y % 31596 local x1, y1 = mfl(x / 31596), mfl(y / 31596) return (x1 * y1 * 62863 + (x1 * y0 + x0 * y1) * 31596 + x0 * y0) % mod end local n = io.read("*n") n = n - 1 local t = {} local box = {} for i = 1, n do t[i] = i box[i] = {} end local function put(dst, val, cnt) local d = dst * 2 <= n and dst or n + 1 - dst if not box[d][val] then box[d][val] = cnt else box[d][val] = box[d][val] + cnt end end for i = 1, n do local v = t[i] if 1 < v then local lim = mfl(n / i) for j = 1, lim do local dst = i * j local c = 0 while t[dst] % v == 0 do t[dst] = mfl(t[dst] / v) c = c + 1 end if 0 < c then put(dst, v, c) end end end end local half = mce(n / 2) if n % 2 == 1 then for k, v in pairs(box[half]) do box[half][k] = v * 2 end end local fullbox = {} for i = 1, half do for k, v in pairs(box[i]) do -- print(i, k, v) if not fullbox[k] then fullbox[k] = v else fullbox[k] = mma(fullbox[k], v) end end end local ret = 1 for k, v in pairs(fullbox) do -- print(k, v) for i = 1, v do ret = bmul(ret, k) end end print(ret)