#include #define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++) #define MOD 1000000007LL using namespace std; typedef long long ll; ll N; ll modulo_power(ll a, ll n) { if(n == 0) return 1; if(n % 2 == 0) return modulo_power((a * a) % MOD, n / 2); return (a * modulo_power(a, n - 1)) % MOD; } int main(void) { cin >> N; if(N == 1) cout << 2 << endl; else if(N == 2) cout << 4 << endl; else if(N % 2 == 0) cout << (4 * modulo_power(5, N / 2 - 1)) % MOD << endl; else cout << (4 * modulo_power(5, N / 2 - 1) * 3) % MOD<< endl; }