You are given an integer N. Find the number of strings of length N that satisfy the following conditions, modulo 10^9+7:

* The string does not contain characters other than `A`, `C`, `G` and `T`.
* The string does not contain `AGC` as a substring.
* The condition above cannot be violated by swapping two adjacent characters once.

Constraints

* 3 \leq N \leq 100

Input

Input is given from Standard Input in the following format:


N


Output

Print the number of strings of length N that satisfy the following conditions, modulo 10^9+7.

Examples

Input

3


Output

61


Input

4


Output

230


Input

100


Output

388130742
def int_raw():
    return int(raw_input())

def ss_raw():
    return raw_input().split()

def ints_raw():
    return map(int,ss_raw())

INF = 1<<29

DIV = (10**9) +7

def make1d_arr(n,val=INF):
    return [val for i in xrange(n)]

def make2d_arr(w,h,val =INF):
    return [[val for i in xrange(w)]for i in xrange(h)]


N = int_raw()

dp = [0]*(N+1)
dp_a = [0]*(N+1)
dp_g = [0]*(N+1)

dp[0] = 1
dp[1] = 4
dp[2] = 16
dp[3] = 61

#dp_ng[3]=3

dp_a[1]=1
dp_a[2]=4
dp_a[3]=16

dp_g[1]=1
dp_g[2]=4
dp_g[3]=15

#dp_t[1]=1
#dp_t[2]=4
#dp_t[3]=16


for i in xrange(4,N+1):
    dp_a[i] = dp[i-1] %DIV
    dp_g[i] = (dp[i-1] - dp[i-3] + dp_g[i-3]) %DIV
    dp [i] = (dp[i-1] + dp_a[i] + dp_g[i] + dp[i-1] - dp_a[i-3]*3 -dp_a[i-2]  - dp_g[i-2]  )%DIV

print dp[N]

