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())
MOD = 1e9 + 7

memo = [{} for _ in range(n + 1)]

def ok(s):
    for i in range(4):
        ls = list(s)
        if i >= 1:
            ls[i], ls[i - 1] = ls[i - 1], ls[i]
        if ''.join(ls).count('AGC') >= 1:
            return False
    return True

def sol(cur, s):
    if s in memo[cur]:
        return memo[cur][s]
    if cur == n:
        return 1
    ret = 0
    for c in 'AGCT':
        if ok(s + c):
            ret = int(ret + sol(cur + 1, s[1:] + c)) % MOD
    memo[cur][s] = int(ret)
    return int(ret)

print(sol(0, 'TTT'))
