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
#include <bits/stdc++.h>
using namespace std;
#define INT(a) scanf("%d",&a)
#define STR(a) scanf("%s",a)
#define DBL(a) scanf("%lf",&a)
#define LNG(a) scanf("%lld",&a)
#define PI acos(-1)
#define MOD 1000000007

int n;
long long memo[105][6][6][6];
long long func(int i, int p1, int p2, int p3){
	//cout<<" "<<p1<<" "<<p2<<" "<<p3<<endl;
	if(i>=n) return 1;
	if(memo[i][p1][p2][p3]!=-1) return memo[i][p1][p2][p3];
	long long p=0, q=0, r=0, s=0;
	p=func(i+1, 1, p1, p2)%MOD;
	if(!((p2==1 && p1==3) || (p3==1 && p2==3) || (p3==1 && p1==3) || (p2==3 && p1==1))) q=func(i+1, 2, p1, p2)%MOD;
	if(!(p2==1 && p1==2)) r=func(i+1, 3, p1, p2)%MOD;
	s=func(i+1, 4, p1, p2)%MOD;
	return memo[i][p1][p2][p3]=(p+q+r+s)%MOD;
}



int main(){
	cin>>n;
	memset(memo, -1, sizeof memo);
	long long ans = func(0, 0, 0, 0);
	cout<<ans<<endl;
	return 0;
}