/*|In The Name Of Allah|*/

#include <bits/stdc++.h>

using namespace std;

const int N = 1e2+5;

const int mod = 1e9+7;

//A 1
//C 2
//G 3
//T 4

int n;
int mem[N][5][5][5];

int go(int idx , int lst1 , int lst2 , int lst3){
    if(idx == n)
        return 1;
    if(~mem[idx][lst1][lst2][lst3])
        return mem[idx][lst1][lst2][lst3];
    int cnt = 0;
    for(int i = 1; i <= 4; i++){
        if(i == 3 && lst1 == 2 && lst2 == 1) continue;
        if(i == 3 && lst1 == 1 && lst2 == 2) continue;
        if(i == 3 && lst2 == 2 && lst3 == 1) continue;
        if(i == 3 && lst1 == 2 && lst3 == 1) continue;
        if(i == 2 && lst1 == 3 && lst2 == 1) continue;

        cnt += go(idx + 1 , i , lst1 , lst2);
        cnt %= mod;
    }
    return mem[idx][lst1][lst2][lst3] = cnt;
}

int main(){
    scanf("%d" , &n);
    memset(mem , -1 , sizeof mem);
    printf("%d\n" , go(0 , 0 , 0 , 0));
}
### Prompt

Please provide a Cpp coded solution 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
/*|In The Name Of Allah|*/

#include <bits/stdc++.h>

using namespace std;

const int N = 1e2+5;

const int mod = 1e9+7;

//A 1
//C 2
//G 3
//T 4

int n;
int mem[N][5][5][5];

int go(int idx , int lst1 , int lst2 , int lst3){
    if(idx == n)
        return 1;
    if(~mem[idx][lst1][lst2][lst3])
        return mem[idx][lst1][lst2][lst3];
    int cnt = 0;
    for(int i = 1; i <= 4; i++){
        if(i == 3 && lst1 == 2 && lst2 == 1) continue;
        if(i == 3 && lst1 == 1 && lst2 == 2) continue;
        if(i == 3 && lst2 == 2 && lst3 == 1) continue;
        if(i == 3 && lst1 == 2 && lst3 == 1) continue;
        if(i == 2 && lst1 == 3 && lst2 == 1) continue;

        cnt += go(idx + 1 , i , lst1 , lst2);
        cnt %= mod;
    }
    return mem[idx][lst1][lst2][lst3] = cnt;
}

int main(){
    scanf("%d" , &n);
    memset(mem , -1 , sizeof mem);
    printf("%d\n" , go(0 , 0 , 0 , 0));
}
```