#include #define rep(i, a, n) for(int i = a; i < n; i++) #define repb(i, a, b) for(int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define o(a) cout << a << endl #define int long long using namespace std; typedef pair P; const int mod = 1e9 + 7; long long mod_pow(long long x, long long n){ if(n == 0) return 1; long long res = mod_pow(x*x % mod, n / 2); if(n & 1) res = res*x % mod; return res; } signed main(){ int n; cin >> n; int ans = 1; if(n == 1){ cout << 2 << endl; return 0; } ans = mod_pow(5, n / 2 - 1); ans = 4 * ans % mod; if(n % 2) ans = ans * 3 % mod; cout << ans << endl; }