#P38. [KBC002F] Count 1

[KBC002F] Count 1

Source

This problem is adapted from Long Long OJ. All rights reserved.

Problem Description

A new bitwise operation \sharp is defined as follows: 00=10\sharp0=1, 01=10\sharp1=1, 11=11\sharp1=1, 10=01\sharp0=0.

Output the number of 0/10/1 strings of length NN (modulo 998 244 353998\ 244\ 353) that satisfy the following conditions:

  • $((((A_1\sharp A_2)\sharp A_3)\sharp\cdots)\sharp A_{N-1})\sharp A_N=1$;
  • $A_1\sharp(A_2\sharp(A_3\sharp(\cdots\sharp(A_{N-1}\sharp A_N))))=1$.

Input Format

An integer NN.

Output Format

The result modulo 998 244 353998\ 244\ 353.

Samples

20
699051

Data Range

1N101000011\le N\le 10^{100001}.