#include using namespace std; using int64 = long long; using uint64 = unsigned long long; const int64 MOD = 1e9 + 7; int64 powMod(int64 a, int64 n) { int64 res = 1, p = a % MOD; while (n > 0) { if (n & 1) { (res *= p) %= MOD; } (p *= p) %= MOD; n >>= 1; } return res; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int64 N; cin >> N; if (N == 1) { // 0, 1, 8 cout << 2 << endl; return 0; } int64 ans = 1; if (N & 1) { ans = 3; N--; } // 1, 8, 0, 9, 6 (ans *= powMod(5, N / 2 - 1)) %= MOD; // 1, 8, 9, 6 (ans *= 4) %= MOD; cout << ans << endl; return 0; }