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 meters long and it is represented as a grid. Initially, twin is at and twin is at , and they set the rules to move along the corridor:
A twin can move to the left tile .
A twin can advance to the tile in front .
A twin can cross in a diagonal, e.g. or .
The destination tiles must exist.
Both move at the same time.
They always move while they are not in the last tiles or .
They finish when both are in any of the last tiles or .
For a given , 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 .
The input starts with the number of test cases . For each test case, there is an integer representing the length of the corridor.
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 .
In the first example there are 8 combinations:
and
and
and
and
and and
and and
and and
and and
Input
2 2 3
Output
8 72