#include<bits/stdc++.h>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
const int p=1e9+7;
int n;
long long f[110][4][4][4],ans;
int main(){
	scanf("%d",&n);
	fo(a,0,3)
		fo(b,0,3)
			fo(c,0,3){
				if (a==0&&b==1&&c==2) continue;
				if (a==1&&b==0&&c==2) continue;
				if (a==0&&b==2&&c==1) continue;
				f[3][a][b][c]++;
			}
	fo(i,3,n-1)
		fo(a,0,3)
			fo(b,0,3)
				fo(c,0,3)
					fo(d,0,3){
						if (b==0&&c==1&&d==2) continue;
						if (b==1&&c==0&&d==2) continue;
						if (b==0&&c==2&&d==1) continue;
						if (a==0&&c==1&&d==2) continue;
						if (a==0&&b==1&&d==2) continue;
						f[i+1][b][c][d]+=f[i][a][b][c];
						if (f[i+1][b][c][d]>=p) f[i+1][b][c][d]-=p;						
					}
	fo(a,0,3)
		fo(b,0,3)
			fo(c,0,3)
				ans+=f[n][a][b][c];
	ans%=p;
	printf("%lld\n",ans);
	return 0;
}
### Prompt

Please create a solution in CPP to the following problem:

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

### Response

```cpp
#include<bits/stdc++.h>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
const int p=1e9+7;
int n;
long long f[110][4][4][4],ans;
int main(){
	scanf("%d",&n);
	fo(a,0,3)
		fo(b,0,3)
			fo(c,0,3){
				if (a==0&&b==1&&c==2) continue;
				if (a==1&&b==0&&c==2) continue;
				if (a==0&&b==2&&c==1) continue;
				f[3][a][b][c]++;
			}
	fo(i,3,n-1)
		fo(a,0,3)
			fo(b,0,3)
				fo(c,0,3)
					fo(d,0,3){
						if (b==0&&c==1&&d==2) continue;
						if (b==1&&c==0&&d==2) continue;
						if (b==0&&c==2&&d==1) continue;
						if (a==0&&c==1&&d==2) continue;
						if (a==0&&b==1&&d==2) continue;
						f[i+1][b][c][d]+=f[i][a][b][c];
						if (f[i+1][b][c][d]>=p) f[i+1][b][c][d]-=p;						
					}
	fo(a,0,3)
		fo(b,0,3)
			fo(c,0,3)
				ans+=f[n][a][b][c];
	ans%=p;
	printf("%lld\n",ans);
	return 0;
}
```