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>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
ll dp[105][4][4][4],n;
ll func(ll len,ll i,ll j,ll k){
    if(i==0&&j==1&&k==2)return 0;
    if(i==0&&j==2&&k==1)return 0;
    if(i==2&&j==0&&k==1)return 0;
    if(len==n)return 1;

    ll &ans = dp[len][i][j][k];
    if(ans!=-1)return ans;

    ans=0;
    for(ll l=0;l<4;l++){
        if(i==0&&k==2&&l==1)continue;
        if(i==0&&j==2&&l==1)continue;
        ans+=func(len+1,j,k,l);
        ans%=mod;
    }
    return ans;
}
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cin>>n;
    memset(dp,-1,sizeof(dp));
    ll ans = 0;
    for(ll i=0;i<4;i++)for(ll j=0;j<4;j++)for(ll k=0;k<4;k++)ans+=func(3,i,j,k),ans%=mod;
    cout<<ans;
}