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 <iostream>
#include <vector>
#include <string>
using ll = long long;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rep2(i, s, n) for(ll i = s; i < n; i++)
using namespace std;

const ll MOD = 1000000007;
int dp[110][5][5][5][5];
int main(){
  ll n;
  cin >> n;
  dp[0][0][0][0][0] = 1;
  rep(i, n)rep(c1, 5)rep(c2, 5)rep(c3, 5)rep(c4, 5)rep2(c5, 1, 5){
    dp[i+1][c2][c3][c4][c5] += dp[i][c1][c2][c3][c4];
    dp[i+1][c2][c3][c4][c5] %= MOD;
    if(c3==1 && c4==3 && c5==2) dp[i+1][c2][c3][c4][c5] = 0;
    if(c2==1 && c4==3 && c5==2) dp[i+1][c2][c3][c4][c5] = 0;
    if(c3==3 && c4==1 && c5==2) dp[i+1][c2][c3][c4][c5] = 0;
    if(c3==1 && c4==2 && c5==3) dp[i+1][c2][c3][c4][c5] = 0;
    if(c2==1 && c3==3 && c5==2) dp[i+1][c2][c3][c4][c5] = 0;
  }
  ll ans = 0;
  rep(c1, 5)rep(c2, 5)rep(c3, 5)rep(c4, 5){
    ans += dp[n][c1][c2][c3][c4];
    ans %= MOD;
  }
  cout << ans << endl;
  
  return 0;
}