/* -*- coding: utf-8 -*- * * 557.cc: No.557 点対称 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ typedef long long ll; const ll MOD = 1000000007; /* typedef */ /* global variables */ /* subroutines */ inline ll powmod(ll a, ll b) { // a^b ll pm = 1; while (b > 0) { if ((b & 1LL) != 0) pm = (pm * a) % MOD; a = (a * a) % MOD; b >>= 1; } return pm; } /* main */ int main() { ll n; cin >> n; if (n == 1) puts("2"); else { ll nh = n / 2; ll p = (4LL * powmod(5, nh - 1)) % MOD; if (n & 1) p = (p * 3) % MOD; printf("%lld\n", p); } return 0; }