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, MOD = int(input()), 10**9+7
memo = [{} for i in range(N+1)]
# Keyが直前の三文字、Valueが作れる文字列の数
# ↑これを文字列の今の長さごとにメモする
# memo[6]['TTT']には直前の三文字がTTTで、
# 6文字目以降の条件に合う文字列の総数が入ってる


# めも化再帰
def dfs(index,last3):
	if last3 in memo[index]:
		return memo[index][last3]
	if index == N:
		return 1
	c_next = 'AT'
	if last3[1:] != 'AC':
		c_next += 'G'
	if ('AG' in last3) == False:
		if  last3[1:] != 'GA':
			if last3[0]+last3[2] != 'AG':
				c_next += 'C'
	count = 0
	for c in c_next:
		count += dfs(index+1,last3[1:]+c)
		count %= MOD

	memo[index][last3] = count
	return count

print(dfs(0,'TTT'))
