#ARC146C. [ARC146C] Even XOR

[ARC146C] Even XOR

Score : 600600 points

Problem Statement

How many sets SS consisting of non-negative integers between 00 and 2N12^N-1 (inclusive) satisfy the following condition? Print the count modulo 998244353998244353.

  • Every non-empty subset TT of SS satisfies at least one of the following:- The number of elements in TT is odd.
    • The XOR\mathrm{XOR} of the elements in TT is not zero.
  • The number of elements in TT is odd.
  • The XOR\mathrm{XOR} of the elements in TT is not zero.
What is $\mathrm{XOR}$?

The bitwise $\mathrm{XOR}$ of non-negative integers $A$ and $B$, $A \oplus B$, is defined as follows:

  • When $A \oplus B$ is written in base two, the digit in the $2^k$'s place ($k \geq 0$) is $1$ if exactly one of the digits in that place of $A$ and $B$ is $1$, and $0$ otherwise.
For example, we have 3 \oplus 5 = 6 (in base two: 011 \oplus 101 = 110).
Generally, the bitwise \mathrm{XOR} of k non-negative integers p_1, p_2, p_3, \dots, p_k is defined as (\dots ((p_1 \oplus p_2) \oplus p_3) \oplus \dots \oplus p_k). We can prove that this value does not depend on the order of p_1, p_2, p_3, \dots, p_k.

Constraints

  • 1N2×1051 \le N \le 2 \times 10^5
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN

Output

Print the answer.

2
15

Sets such as {0,2,3}\lbrace 0,2,3 \rbrace, {1}\lbrace 1 \rbrace, and {}\lbrace \rbrace satisfy the condition.

On the other hand, {0,1,2,3}\lbrace 0,1,2,3 \rbrace does not.

This is because the subset {0,1,2,3}\lbrace 0,1,2,3 \rbrace of {0,1,2,3}\lbrace 0,1,2,3 \rbrace has an even number of elements, whose bitwise XOR\mathrm{XOR} is 00.

146
743874490