#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define min(a, b) (a > b ? b : a)
#define chmax(a, b) a = (a >= b ? a : b)
#define chmin(a, b) a = (a <= b ? a : b)
#define out(a) cout << a << endl
#define outa(a, n) { rep(_, n) cout << a[_] << " "; cout << endl; }
#define outp(a, n) { cout << endl; rep(_, n) cout << a[_].F << " " << a[_].S << endl; }
#define SZ(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
#define FIX(a) fixed << setprecision(a)
#define LB(v, n) (int)(lower_bound(all(v), n) - v.begin())
#define UB(v, n) (int)(upper_bound(all(v), n) - v.begin())
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll nck(int n, int k) { ll ret = 1; rep(i, k) {ret *= n - i; ret /= i + 1; } return ret; } // n <= 60
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }


const int mod = 1e9 + 7;
struct mint {
    ll x;
    mint (ll x = 0) : x(x % mod) {}
    mint& operator += (const mint a) { // コンストラクタの、modで割った余りがくる
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator -= (const mint a) {
        if ((x += -a.x + mod) >= mod) x -= mod;
        return *this;
    }
    mint& operator *= (const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator + (const mint a) const {
        mint res(*this);
        return res += a; // ?
    }
    mint operator - (const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator * (const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const { // mint(a).pow(t) tは余りとったりしたらあかん
        if (t == 0) return 1;
        mint a = pow(t >> 1); // 再帰
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    
    // 逆元
    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator /= (const mint a) { // invを利用
        return (*this) *= a.inv();
    }
    mint operator / (const mint a) const {
        mint res(*this);
        return res /= a;
    }
    friend ostream &operator<<(ostream &s, mint a) { return s << a.x; }
};

mint dp[101][4][4][4];
int n;
enum { A, C, G, T };

void OUT() {
    rep3(i, 2, n + 1) {
        cout << "i " << i << endl;
        rep(j, 4) {
            cout << "j " << j << endl;
            rep(k, 4) {
                cout << "k " << k << endl;
                rep(m, 4) cout << dp[i][j][k][m] << " "; cout << endl;
            }
        }
        cout << endl << endl << endl;
    }
}

void init() {
    rep(j, 4) rep(k, 4) rep(l, 4) {
        if (j == A && k == G && l == C) continue;
        if (j == A && k == C && l == G) continue;
        if (j == G && k == A && l == C) continue;
        dp[3][j][k][l] = 1;
    }
}
char hen(int k) {
    if (k == 0) return 'A';
    else if (k == 1) return 'C';
    else if (k == 2) return 'G';
    return 'T';
}

void solve() {
    init();
    vector<string> v;
    rep3(i, 3, n) rep(m, 4) rep(j, 4) rep(k, 4) rep(l, 4) {
        if (m == A && j == G && l == C) continue;
        if (m == A && k == G && l == C) continue;
        if (j == A && k == G && l == C) continue;
        if (j == A && k == C && l == G) continue;
        if (j == G && k == A && l == C) continue;
        dp[i + 1][j][k][l] += dp[i][m][j][k];
        
        /*
        vector<int> tmp;
        tmp.eb(m); tmp.eb(j); tmp.eb(k); tmp.eb(l);
        int cnt[4] = {0};
        rep(o, 4) {
            cnt[tmp[o]]++;
        }
        if (cnt[3] >= 2 || cnt[0] >= 3) continue;
        int flg = 0;
        rep(o, 4) if (cnt[o] == 0) { flg = 1; }
        if (flg) continue;
        
        
        string str;
        str += hen(m);
        str += hen(j);
        str += hen(k);
        str += hen(l);
        v.eb(str);
         */
    }
    sort(all(v));
    outa(v, SZ(v));
    mint ans = 0;
    rep(m, 4) rep(j, 4) rep(k, 4) ans += dp[n][m][j][k];
    out(ans);
    
    // OUT();
    
    
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    
    cin >> n;
   
    solve();
    
}


Measured memory_bytes: 256