I. Rolling Egg
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Rocq the rooster owns a single egg. One day, he came back home and noticed his egg was missing! The egg is rolling around in a field — in fact, the field $$$\mathbb{Z}_p$$$, where $$$p$$$ is a prime. His egg has been studying number theory, and he knows that his egg used the following procedure to determine what path to roll away with:

  1. Pick some (uniformly) random starting location $$$x_0 \in \mathbb{Z}_p$$$.
  2. Pick some (uniformly) random polynomial $$$f \in \mathbb{Z}_p[x]$$$.
  3. For times $$$t \gt 0$$$, the egg will roll from $$$x_{t - 1}$$$ to $$$x_t := f(x_{t - 1})$$$.

It is guaranteed the egg will eventually roll in a cycle between different locations. If Rocq can find out the expected length of the cycle, he can somehow catch the egg. Given the prime $$$p$$$, help him by finding this expectation! He doesn't like decimals, so output the answer mod $$$998244353$$$.

More formally, let $$$P = 998244353$$$. It can be shown that the answer can be represented as an irreducible fraction $$$\frac{a}{b}$$$, where $$$a$$$ and $$$b$$$ are integers and $$$b \not\equiv 0 \pmod P$$$. Output the integer $$$x$$$ such that $$$0 \leq x \lt P$$$ and $$$x \equiv a \cdot b^{-1} \pmod P$$$.

Input

The input will consist of a single integer $$$p$$$ ($$$1 \leq p \leq 2 \cdot 10^5$$$) — the size of field the egg travels in. It is guaranteed that $$$p$$$ is a prime.

Output

Output the expected length of the cycle the egg ends up in, mod $$$998244353$$$.

Examples
Input
2
Output
748683266
Input
5
Output
760262901
Note

The answer for the $$$p = 2$$$ is $$$\frac{5}{4}$$$, and $$$5 \cdot 4^{-1} \bmod 998244353 = 748683266$$$.