Long Grid Covering
시간 제한2초메모리 제한512 MB
3×n 격자를 세 칸짜리 일자 트로미노로 빈틈없이 채우는 경우의 수를 10^9+7로 나눈 나머지로 구한다. n은 10^18까지 주어진다.
문제
We have a grid of height and width , as well as pieces that occupy adjacent cells. Given , determine the number of ways to fill the grid so that each cell is covered by exactly one piece and no piece sticks out of the grid. Here there is an example of a way to fill a grid of width :

Notice that any piece will be a rotation of one of the pieces of this example. Find the answers modulo .
입력
The first line contains an integer , the number of test cases ().
Each test case is given on a separate line containing an integer (), the width of the grid.
출력
For each test case, print a line with a single integer: the number of ways to fill the grid with aforementioned conditions modulo .