Sherlock and Square
Difficulty: Hard

Watson gives a square of side length 1 to Sherlock. Now, after each second, each square of some arbitrary side $L$ will break into four squares each of side $L/2$(as shown in the image below). 

![img][123]

Now, Watson asks Sherlock: What will be the sum of length of solid lines after $N$ seconds?  

As the number can be large print result mod $(10^9 + 7)$.

For example, after 0 seconds, the length is 4.    
After 1 second, the length is 6.

**Input Format**    
First line contains $T$, the number of testcases. Each testcase contains $N$ in one line.   

**Output Format**

For each testcase, print the required answer in a new line. 

**Constraints**   
$1 \le T \le 10^5$    
$0 \le N \le 10^9$

**Sample input**

    3
    0
    1
    5
    
**Sample output**

    4
    6
    66

[123]: http://i.imgur.com/yXME9kL.png

Input Format:

Output Format:

Sample Input:

Sample Output:

Python 3 starter code:
#
# Complete the 'solve' function below.
#
# The function is expected to return an INTEGER.
# The function accepts INTEGER n as parameter.
#

def solve(n):
    # Write your code here




Reference solution (Python):
###Python 2  
```python  
MOD=10**9+7
def mpow(a,n):
    if n==0: return 1
    elif n==1: return a
    p=mpow(a,n/2)
    if (n&1):
        return (p*p*a)%MOD
    else: return (p*p)%MOD
t=input()
while t:
    n=input()
    print (4+2*(mpow(2,n)-1))%MOD
    t-=1
```