#P7817. Paperfolding

Paperfolding

Paperfolding

Problem Description

There is a piece of paper in rectangular shape with sufficient length and width (lay flat on the table). Execute an operation instruction according to a string of length nn from left to right that only contains 44 different characters of LL,RR,UU,DD.

  1. LL instruction means to fold it from left to right,
  2. RR instruction means to fold from right to left,
  3. UU instruction means to fold from top to bottom,
  4. DD instruction means to fold in half from bottom to top. Note that the operation is limited due to the limitation of the desktop. Namely, the fold operation is restricted. For example, if you fold the paper from left to right, you should let the left side overlap on the right side with no rotation. Now, cut a knife horizontally (completely cut) at the center of the visible part of the paper, and then cut vertically (completely cut). The number of pieces of the whole paper split is num(S)num(S). See the example and the picture for better understanding. Now given a nonnegative integer nn, the string SS is generated from 4n4^n different possible outcomes in equal probability. Find the expected value of the number of pieces of the paper which is split, that is E(num(S))E(num(S)) mod 998244353998244353. It can be shown that the answers can be represented by PQ\frac{P}{Q}, where PP and QQ are coprime integers, and print the value of P×Q1 modP \times Q^{-1} \ mod  998244353\space 998244353. 图片

Input

The first line contains a single integer T T (1T1051 \le T \le 10^5), the number of testcases. Each of the next T T lines contains a number n n ( 0n10180 \le n \le 10^{18} ).

Output

For each testcase, print the answer in one line.

Sample Input

2
0
1

Sample Output

4
6

Source

2020 Multi-University Training Contest 5