#include using namespace std; typedef long long int64; int64 pow_mod(int64 x, int64 n, int64 mod) { int64 ret = 1; while(n > 0) { if(n & 1) (ret *= x) %= mod; (x *= x) %= mod; n >>= 1; } return ret; } const int mod = 1e9 + 7; int main() { int64 N; cin >> N; if(N == 1) { cout << 2 << endl; } else if(N == 2) { cout << 4 << endl; } else if(N == 3) { cout << 12 << endl; } else if(N % 2 == 0LL) { N /= 2; --N; cout << pow_mod(5, N, mod) * 4 % mod << endl; } else { N /= 2; --N; cout << pow_mod(5, N, mod) * 3 * 4 % mod << endl; } }