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>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
using namespace std;
using ll = long long;
const ll MOD = 1000000007;

ll dp[110][4][4][4];

int main()
{
    ll n;
    cin >> n;

    dp[0][3][3][3] = 1;

    rep(len, 0, n + 1)
    rep(c1, 0, 4)
    rep(c2, 0, 4)
    rep(c3, 0, 4)
    rep(now, 0, 4)
    {
        if (now == 2 and c1 == 1 and c2 == 0) continue;
        if (now == 2 and c1 == 1 and c3 == 0) continue;
        if (now == 2 and c1 == 0 and c2 == 1) continue;
        if (now == 1 and c1 == 2 and c2 == 0) continue;
        if (now == 2 and c2 == 1 and c3 == 0) continue;

        dp[len + 1][now][c1][c2] += dp[len][c1][c2][c3];
        dp[len + 1][now][c1][c2] %= MOD;
    }

    ll ans = 0;
    rep(c1, 0, 4)
    rep(c2, 0, 4)
    rep(c3, 0, 4)
    {
        ans += dp[n][c1][c2][c3];
        ans %= MOD;
    }
    cout << ans << endl;
}
