#include <iostream>
long long mod=1e9+7,A,d[100][256];
int main(){
  int N;
  std::cin>>N;
  for(int i=0;i<256;i++)d[0][i]=(i/4==0);
  for(int i=1;i<N;i++){
    for(int j=0;j<1024;j++)d[i][j%256]+=d[i-1][j/4]%mod;
    if(i>1)for(int j=0;j<256;j+=64)d[i][j+6]=d[i][j+18]=d[i][j+9]=0;
    if(i>2)d[i][22]=d[i][54]=d[i][30]=0;
  }
  for(int i=0;i<256;i++)A+=d[N-1][i];
  std::cout<<A%mod;
}


### Prompt

Please formulate a Cpp solution to the following problem:

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

### Response

```cpp
#include <iostream>
long long mod=1e9+7,A,d[100][256];
int main(){
  int N;
  std::cin>>N;
  for(int i=0;i<256;i++)d[0][i]=(i/4==0);
  for(int i=1;i<N;i++){
    for(int j=0;j<1024;j++)d[i][j%256]+=d[i-1][j/4]%mod;
    if(i>1)for(int j=0;j<256;j+=64)d[i][j+6]=d[i][j+18]=d[i][j+9]=0;
    if(i>2)d[i][22]=d[i][54]=d[i][30]=0;
  }
  for(int i=0;i<256;i++)A+=d[N-1][i];
  std::cout<<A%mod;
}


```