#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#define int long long
#define mod 1000000007
using namespace std;

int dp[200][64];
signed main() {
	int n; cin >> n;
	dp[0][63] = 1;
	for (int i = 0; i < n + 5; i++) {
		for (int j = 0; j < 64; j++) {
			int x = 0, y = 0, z = 0, w = j;
			x = w % 4; w /= 4; y = w % 4; w /= 4; z = w % 4;
			if (j == 36 || j == 24 || j == 33) { 
				dp[i][j] = 0; continue; }
			for (int k = 0; k < 4; k++) {
				dp[i + 1][k * 16 + z * 4 + y] += dp[i][j];
				if (x == 0 && y == 1 && k == 2) {
					dp[i + 1][k * 16 + z * 4 + y] -= dp[i][j];
				}
				else if (x == 0 && z == 1 && k == 2) {
					dp[i + 1][k * 16 + z * 4 + y] -= dp[i][j];
				}
				dp[i + 1][k * 16 + z * 4 + y] %= mod;
			}
		}
	}
	int ans = 0;
	for (int i = 0; i < 64; i++) {
		ans += dp[n][i];
	}
	cout << ans%mod << endl;
}
### Prompt

In cpp, your task is to solve 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<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#define int long long
#define mod 1000000007
using namespace std;

int dp[200][64];
signed main() {
	int n; cin >> n;
	dp[0][63] = 1;
	for (int i = 0; i < n + 5; i++) {
		for (int j = 0; j < 64; j++) {
			int x = 0, y = 0, z = 0, w = j;
			x = w % 4; w /= 4; y = w % 4; w /= 4; z = w % 4;
			if (j == 36 || j == 24 || j == 33) { 
				dp[i][j] = 0; continue; }
			for (int k = 0; k < 4; k++) {
				dp[i + 1][k * 16 + z * 4 + y] += dp[i][j];
				if (x == 0 && y == 1 && k == 2) {
					dp[i + 1][k * 16 + z * 4 + y] -= dp[i][j];
				}
				else if (x == 0 && z == 1 && k == 2) {
					dp[i + 1][k * 16 + z * 4 + y] -= dp[i][j];
				}
				dp[i + 1][k * 16 + z * 4 + y] %= mod;
			}
		}
	}
	int ans = 0;
	for (int i = 0; i < 64; i++) {
		ans += dp[n][i];
	}
	cout << ans%mod << endl;
}
```