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 <cstdio>
using lli=long long int;
const lli mod=1000000007;
int main(){
  int N;
  scanf("%d",&N);

  lli dp[100][256]={};
  for(int i=0;i<256;i++) dp[0][i]=(i/4==0);
  for(int i=1;i<N;i++){
    for(int j=0;j<1024;j++) dp[i][j%256]=(dp[i][j%256]+dp[i-1][j/4])%mod;
    if(i>1) for(int j=0;j<4;j++) dp[i][j*64+0*16+1*4+2]=dp[i][j*64+1*16+0*4+2]=dp[i][j*64+0*16+2*4+1]=0; //*AGC,*GAC,*ACG
    if(i>2) dp[i][0*64+1*16+1*4+2]=dp[i][0*64+3*16+1*4+2]=dp[i][0*64+1*16+3*4+2]=0; //AGGC,ATGC,AGTC
  }

  lli ans=0;
  for(int i=0;i<256;i++) ans+=dp[N-1][i];
  printf("%ld\n",ans%mod);
  return 0;
}

