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 <iostream>
#include <cstdio>
#define N 105
using namespace std;

typedef long long ll;
ll M = 1e9 + 7;
ll n, s, d[N][70];

bool f(ll p, ll q) {
	if (p >= 0 && p % q == 0 && p / q < 4) return 1;
	return 0;
}

int main()
{
	ll i, j;
	cin >> n;
	d[0][0] = 1;
	for (i = 1; i <= n; i++) {
		for (j = 0; j < 256; j++) {
			if (f(j - 27, 64)) continue;
			if (f(j - 30, 64)) continue;
			if (f(j - 54, 64)) continue;
			if (f(j - 78, 16)) continue;
			if (f(j - 114, 4)) continue;
			d[i][j % 64] = (d[i][j % 64] + d[i - 1][j / 4]) % M;
		}
	}
	for (i = 0; i < 256; i++) s = (s + d[n][i]) % M;
    cout << s << endl;
    return 0;
}