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;
using ll=long long;
const int MOD=1e9+7;

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

bool ng(int a,int b,int c){
  return a==1&&b==2&&c==3;
}

bool check(int a,int b,int c,int d){
  return ng(a,b,c)||ng(b,a,c)||ng(a,c,d)||ng(a,c,b)||ng(a,b,d);
}

ll f(int idx,int a,int b,int c){
  if(~dp[idx][a][b][c])return dp[idx][a][b][c];
  if(!idx)return 1;
  ll res=0;
  for(int i=0;i<4;i++)if(!check(i,a,b,c))res+=f(idx-1,i,a,b);
  return dp[idx][a][b][c]=res%MOD;
}

int main(){
  memset(dp,-1,sizeof(dp));
  int n;cin>>n;
  cout<<f(n,5,5,5)<<endl;
}
