#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
using P = pair<int,int>;
int dp[101][4][4][4];
const int mod = 1000000007;
int main()
{
    int n;
    cin >> n;
    dp[0][3][3][3] = 1;
    rep(i,n)rep(a,4)rep(b,4)rep(c,4){
        rep(x,4){
            if(x == 2&&a == 1&&b == 0)continue;
            if(x == 1&&a == 2&&b == 0)continue;
            if(x == 2&&a == 0&&b == 1)continue;
            if(x == 2&&b == 1&&c == 0)continue;
            if(x == 2&&a == 1&&c == 0)continue;
            
            dp[i+1][x][a][b] += dp[i][a][b][c];
            dp[i+1][x][a][b] %= mod;


        }
    }
    int ans = 0;
    rep(a,4)rep(b,4)rep(c,4){
        ans+=dp[n][a][b][c];
        ans%= mod;
    }
    cout << ans << endl;

    return 0;
}
### Prompt

Construct a CPP code solution to the problem outlined:

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 rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
using P = pair<int,int>;
int dp[101][4][4][4];
const int mod = 1000000007;
int main()
{
    int n;
    cin >> n;
    dp[0][3][3][3] = 1;
    rep(i,n)rep(a,4)rep(b,4)rep(c,4){
        rep(x,4){
            if(x == 2&&a == 1&&b == 0)continue;
            if(x == 1&&a == 2&&b == 0)continue;
            if(x == 2&&a == 0&&b == 1)continue;
            if(x == 2&&b == 1&&c == 0)continue;
            if(x == 2&&a == 1&&c == 0)continue;
            
            dp[i+1][x][a][b] += dp[i][a][b][c];
            dp[i+1][x][a][b] %= mod;


        }
    }
    int ans = 0;
    rep(a,4)rep(b,4)rep(c,4){
        ans+=dp[n][a][b][c];
        ans%= mod;
    }
    cout << ans << endl;

    return 0;
}
```