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
n = int(input())
s = ["A","T","G","C"]
ban = ["AGC","ACG","GAC"]
ban4 = ["ATGC","AGTC","AGGC"]
last3 = [{},{}]
zl = {}
for i in s:
    for j in s:
        for k in s:
            if i+j+k not in ban:
                last3[0][i+j+k] = 1
                zl[i+j+k] = 0
last3[1] = zl.copy()

for k in range(3,n):
    for i in last3[0]:
        for j in s:
            l = i+j
            if not (l in ban4 or l[1:] in ban):
                last3[1][l[1:]] += last3[0][i]
    last3[0] = last3[1]
    last3[1] =zl.copy()

print(sum(last3[0].values())%(10**9+7))