Khada_Jhin is learning theoretical computer science.
Today, Jwong asked Khada_Jhin a question: for a string of length n consisting of 0 and 1, how many fundamentally different arrangements of grey code are there?
A permutation of length n is an array p = p0p1p2...pn - 1 consisting of n distinct integers from 0 to n - 1 in any order. A circular permutation is treated as a special permutation whose p0 is always 0.
An arrangement of grey code is a circular permutation p = p0p1p2...p2n - 1, such that all pi and pi + 1 are just one digit different in binary. In particular, p2n - 1 and p0 also need to satisfy just one digit difference in binary.
But this question is so hard for Khada_Jhin, so Jwong simplifies the problem, now Khada_Jhin must compute for a string of length n consisting of 0, 1, how many fundamentally different arrangements of grey-like code?
We also define an arrangement of grey-like code as a circular permutation p = p0p1p2...p2n - 1, such that for all pi and pi + 1, the last n-1 bit of pi must be the same as the first n-1 bit of pi + 1 in binary.In particular, p2n - 1 and p0 also need to satisfy the last n-1 bit of p2n - 1 must be the same as the first n-1 bit of p0 in binary.
For example, when n = 2, the answer is equal to 1. Just one legal answer is 00, 01, 11, 10 in binary.
Now it becomes an easy question for Khada_Jhin, but he wants to check if he made a mistake, so please tell him what the answer is modulo 998244353.
Just input one integer n, satisfying 1 ≤ n ≤ 109.
Just output one integer, which is the answer modulo 998244353.
2
1
114514
518172623
| Name |
|---|


