Problem:
Score : 800 points

Problem Statement

Given is a positive even number N.

Find the number of strings s of length N consisting of A, B, and C that satisfy the following condition:

s can be converted to the empty string by repeating the following operation:

Choose two consecutive characters in s and erase them. However, choosing AB or BA is not allowed.

For example, ABBC satisfies the condition for N=4, because we can convert it as follows: ABBC → (erase BB) → AC → (erase AC) → (empty).

The answer can be enormous, so compute the count modulo 998244353.

Constraints

2 \leq N \leq 10^7

N is an even number.

Input

Input is given from Standard Input in the following format:

N

Output

Print the number of strings that satisfy the conditions, modulo 998244353.

Sample Input 1

2

Sample Output 1

7

Except AB and BA, all possible strings satisfy the conditions.

Sample Input 2

10

Sample Output 2

50007

Sample Input 3

1000000

Sample Output 3

210055358

Solution in Haskell (GHC 7.10.3) (judge verdict: Wrong Answer)

main :: IO ()
main = do
  l1 <- getLine
  let n = read l1 :: Integer
  print $ h $ pow' 3 n 1 - (sum (map (f n) [1,3..n])`mod`998244353)

f n m = fact' n 1`div`(fact' m 1 * fact' (n - m) 1)

pow' x 0 acc = acc
pow' x n acc = pow' x (n-1) $ x*acc`mod`998244353

fact' 0 acc = acc
fact' n acc = fact' (n-1) $ n*acc`mod`998244353

h x = if x < 0 then x + 998244353 else x