#include<bits/stdc++.h>
using namespace std;

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
ll MOD = 1e9+7;

int main(){
  ll i, j;
  ll n;
  cin >> n;
  ll result = 0;
  ll dp[100][64];
  ll buf;
  for(i = 0; i < 64; i++){
    dp[2][i] = 1;
  }
  dp[2][9] = 0;
  dp[2][33] = 0;
  dp[2][6] = 0;
  for(i = 3; i < n; i++){
    for(j = 0; j < 64; j++){
      buf = j / 4;
      if(j % 16 != 9 && (j / 16 != 2 || j % 4 != 1)){
        dp[i][j] = (dp[i-1][buf] + dp[i-1][buf+16] + dp[i-1][buf+32]+dp[i-1][buf+48]) % MOD;
      }
      else      
        dp[i][j] = (dp[i-1][buf+16] + dp[i-1][buf+32]+dp[i-1][buf+48]) % MOD; 
    }
    dp[i][9] = 0;
    dp[i][33] = 0;
    dp[i][6] = 0;


  }
  for(j = 0,result=0; j < 64; j++){
    result += dp[n-1][j];
    result %= MOD;
  }
  cout << result % MOD << endl;

  return 0;
}
### Prompt

Develop a solution in cpp to the problem described below:

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<bits/stdc++.h>
using namespace std;

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
ll MOD = 1e9+7;

int main(){
  ll i, j;
  ll n;
  cin >> n;
  ll result = 0;
  ll dp[100][64];
  ll buf;
  for(i = 0; i < 64; i++){
    dp[2][i] = 1;
  }
  dp[2][9] = 0;
  dp[2][33] = 0;
  dp[2][6] = 0;
  for(i = 3; i < n; i++){
    for(j = 0; j < 64; j++){
      buf = j / 4;
      if(j % 16 != 9 && (j / 16 != 2 || j % 4 != 1)){
        dp[i][j] = (dp[i-1][buf] + dp[i-1][buf+16] + dp[i-1][buf+32]+dp[i-1][buf+48]) % MOD;
      }
      else      
        dp[i][j] = (dp[i-1][buf+16] + dp[i-1][buf+32]+dp[i-1][buf+48]) % MOD; 
    }
    dp[i][9] = 0;
    dp[i][33] = 0;
    dp[i][6] = 0;


  }
  for(j = 0,result=0; j < 64; j++){
    result += dp[n-1][j];
    result %= MOD;
  }
  cout << result % MOD << endl;

  return 0;
}
```