#include using namespace std; #define ll long long ll mod = 1e9 + 7; ll power_mod(ll a, ll n) { if (n == 0) return 1; if (n%2 == 0) return power_mod((a * a) % mod, n/2); return (a * power_mod(a, n-1)) % mod; } int main(void) { ll n; cin >> n; ll ans = 4; ll temp = 1; if (n==1) { cout << 2 << endl; return 0; } ans *= power_mod(5, n/2-1); ans *= temp; if (n%2 != 0) ans *= 3; cout << ans%mod << endl; return 0; }