Twins

HOLIDAYS ARE COMING!

Last day of the advanced algorithmic classes and two siblings are walking in a big corridor. But one of the twins asks his brother: “Do you know in how many ways we can walk through this corridor?”

The corridor is LL meters long and it is represented as a 2×L2 \times L grid. Initially, twin AA is at (1,1)(1,1) and twin BB is at (2,1)(2,1), and they set the rules to move along the corridor:

For a given L>1L > 1, return the number of of ways in which the twins can walk through the corridor. Because this number could be very large, return the result modulo 109+710^9 + 7.

Input

The input starts with the number of test cases T1000T \leq 1000. For each test case, there is an integer L106L \leq 10^6 representing the length of the corridor.

Output

For each test case, output an integer on a single line representing the number of ways in which the twins can walk through the corridor, modulo 109+710^9 + 7.

In the first example there are 8 combinations:

Problem information

Author: Javier Segovia

Generation: 2026-01-25T22:01:36.713Z

© Jutge.org, 2006–2026.
https://jutge.org