Triomino#236

Triomino

1 second
64 megabytes
Very easy (≈850)

In how many ways can you tile a 2 \times n rectangle with triominoes? A triomino is a geometric figure made up of three 1 \times 1 squares joined along their full edges. There are exactly two possible triominoes:

For example, a 2 \times 3 rectangle can be tiled in exactly different ways.

Since the answer may be large, output the number of ways modulo 10^6.

Input

The first line contains the number of test cases (1 \le t \le 100). Each of the next lines contains an integer (0 < n < 10^9).

Output

For each test case, print on a separate line the number of ways to tile a 2 \times n rectangle. Output the answer modulo 10^6.

Examples

Example 1

Loading
Loading