#P4708. 画画

画画

Description

yww is going to start drawing.

There is a sheet of paper on the ground, and there are nn points on it.

yww wants to draw edges between the points. His way of drawing edges is very regular. Each time, he will hold the pen, choose a point, and draw an edge from this point xx to another point yy, then draw an edge from yy to another point zz, and so on, until he finally returns to point xx. yww will do this process several times. Also, from start to finish, yww will never draw more than one edge between the same two points.

yww wants to know how many essentially different graphs he can draw in total. Two graphs are essentially the same if and only if there exists a permutation of the points such that, for the original graph and the new graph after applying the permutation, for any two points, either both graphs have no edge between them, or both graphs have an edge between them. You only need to output the answer modulo 998244353998244353.

In one sentence: the number of unlabeled graphs on nn vertices such that every connected component has an Euler circuit.

Input Format

The first line contains an integer nn.

Output Format

Output one integer.

4
3
5
7

Hint

For 10%10\% of the testdata, n5n \le 5.

For 40%40\% of the testdata, n10n \le 10.

For 100%100\% of the testdata, 1n501 \le n \le 50.

Translated by ChatGPT 5