#include using namespace std; #define FOR(i,l,r) for(int i = int(l);i < int(r);i++) template bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; } template bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; } typedef long long ll; ll N; const ll MOD = 1e9 + 7; ll mod_pow(ll x,ll y = MOD - 2) { ll res = 1; while(y){ if(y & 1) (res *= x) %= MOD; (x *= x) %= MOD; y >>= 1; } return res; } int main() { scanf("%lld",&N); if(N == 1){ puts("2"); return 0; } ll ans = 1; if(N % 2){ ans *= 3; } (ans *= mod_pow(5,N / 2 - 1) * 4) %= MOD; printf("%lld\n",ans); return 0; }