#include using namespace std; typedef long long ll; const ll MOD = ll(1e9 + 7); ll modpow(ll x, ll y, ll m) { if(y == 0) return 1; ll res = modpow(x, y / 2, m); return res * res % m * (y & 1 ? x : 1) % m; } int main() { cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; if(N == 1) { cout << 2 << endl; return 0; } ll ans = 1; if(N >= 2) { ans *= 4; if(N >= 4) { ans *= modpow(5, N / 2 - 1, MOD); ans %= MOD; } } if(N % 2) { ans *= 3; ans %= MOD; } cout << ans << endl; }