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
Mod = 10**9+7
f3 = ["AGC", "GAC", "ACG"]
f4 = ["AGAC","AGGC","AGCC","AGTC"] + ["AAGC","AGGC","ACGC","ATGC"]
q = ["A", "G", "C", "T"]

d = {}
e = {}
for x in q:
  for y in q:
    for z in q:
      s = x+y+z
      if not s in f3:
        d[s] = 1
        e[s] = 0
      
n = int(input())
for i in range(n-3):
  for s in e.keys():
    for c in q:
      t = s+c
      if t[1:] in f3 or t in f4:
        continue
      e[t[1:]] = (e[t[1:]]+d[s])%Mod
  for s in e.keys():
    d[s] = e[s]
    e[s] = 0
    
print(sum(d.values())%Mod)
