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;
enum Char{A,C,G,T};
long N,memo[111][6][6][6][6],mod=1e9+7;
// b3は3文字前,b2は2文字前,b1は1文字前
long rec(int now,int b3,int b2,int b1,int b){
  // printf("%d %d %d %d %d\n",now,b3,b2,b1,b);
  if(memo[now][b3][b2][b1][b]!=-1)return memo[now][b3][b2][b1][b];
  if(b3==A&&b2==G&&b==C)return 0;// AG?Cの場合
  if(b3==A&&b1==G&&b==C)return 0;// A?GCの場合
  if(b2==A&&b1==G&&b==C)return 0;// ?AGCの場合
  if(b2==A&&b1==C&&b==G)return 0;// ?ACGの場合
  if(b2==G&&b1==A&&b==C)return 0;// ?GACの場合
  if(now==N)return 1;
  long ans=0;
  for(int i=0;i<4;i++)ans+=rec(now+1,b2,b1,b,i);
  return memo[now][b3][b2][b1][b]=ans%mod;
}
int main(){
  cin>>N;
  memset(memo,-1,sizeof(memo));
  cout<<rec(0,T,T,T,T)<<endl;
}
