#include using namespace std; const int mod = 1000000007; int modpow(int a, long long b) { int ret = 1; while (b) { if (b & 1) ret = 1LL * ret * a % mod; a = 1LL * a * a % mod; b >>= 1; } return ret; } long long n; int main() { cin >> n; if (n == 1) cout << 2 << endl; else { int ret = 4LL * modpow(5, n / 2 - 1) % mod; if (n % 2 == 1) ret = 3LL * ret % mod; cout << ret << endl; } return 0; }