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<algorithm>
using namespace std;


int main() {
	long long e = 1000000007;
	int n;
	cin >> n;
	long long num[101], a[101], b[101];
	num[1] = 4;
	num[2] = 16;
	num[3] = 61;
	num[4] = 230;
	a[1] = 1;
	a[2] = 4;
	b[1] = 0;
	b[2] = 1;
	for (int i = 5; i <= n; i++) {
		num[i] = 4 * num[i - 1] - 3 * num[i - 4] - 3 * num[i - 3] + (a[i - 3] + b[i - 3]);
		a[i - 2] = num[i - 3] - b[i - 3];
		b[i - 2] = num[i - 4] - a[i - 4];

		if (num[i] >= e) {
			long long m = num[i] % e;
			num[i] = m;
		}
		if (a[i-2] >= e) {
			long long m = a[i-2] % e;
			a[i-2] = m;
		}
		if (b[i-2] >= e) {
			long long m = b[i-2] % e;
			b[i-2] = m;
		}
		while (num[i] <0) {
			num[i] += e;
		}
		if (a[i - 2] <0) {
			a[i - 2] += e;
		}
		if (b[i - 2] <0) {
			b[i - 2] += e;
		}
	}
	cout << num[n] << endl;
	return 0;

}