King Tle4Ever of Time Limit Exceeded has recently appointed Ram as his new cashier. To get this job Ram has paid 1 SegFault (SegFault is the currency of Time Limit Exceeded). Today is his first day at work and he will get 1 SegFault for his salary. As Tle4Ever thought this is really less so for the coming days he thought of paying Ram a good amount of SegFaults. For the ith day Ram gets twice the SegFaults for (i-1)th, thrice the SegFaults for (i-2)th day and 3i as bonus for working on ith day.
As you can see Ram is getting a huge amount of SegFaults, he wants to calculate how much SegFaults will he get on kth day. As he is busy working for King, he asks you to tell him the SegFaults he will get on kth day. As the no of SegFaults can be large and to save you from outputting random values, I ask you to print ans % 109 + 7.
[Input]
First line of input consists of single integer t denoting number of test cases.
Next t line contains single integer k denoting the kth day.
[Output]
For each test case print single integer containing ans % 109 + 7.
[Constraints]
1<=t<=105
0<=k<=109