#include "bits/stdc++.h" #define ALL(obj) (obj).begin(),(obj).end() #define RALL(obj) (obj).rbegin(),(obj).rend() #define REP(i, n) for(int i = 0; i < (int)(n); i++) #define REPR(i, n) for(int i = (int)(n); i >= 0; i--) #define FOR(i,n,m) for(int i = (int)(n); i < int(m); i++) using namespace std; typedef long long ll; const int MOD = 1e9 + 7; const int INF = MOD - 1; const ll LLINF = 4e18; struct mint { private: ll x; public: mint(ll x = 0) :x(x%MOD) {} mint& operator+=(const mint a) { if ((x += a.x) >= MOD) x -= MOD; return *this; } mint& operator-=(const mint a) { if ((x += MOD - a.x) >= MOD) x -= MOD; return *this; } mint& operator*=(const mint a) { (x *= a.x) %= MOD; return *this; } mint operator+(const mint a) const { mint res(*this); return res += a; } mint operator-(const mint a) const { mint res(*this); return res -= a; } mint operator*(const mint a) const { mint res(*this); return res *= a; } friend ostream& operator<<(ostream& os, const mint& n) { return os << n.x; } }; //pow template T pow(T n, U k) { T x = 1; while (k > 0) { if (k & 1) { x *= n; } n *= n; k >>= 1; } return x; } int main() { ll n; cin >> n; mint ans = 1; if (n == 1) { ans = 2; } else { if (n % 2 == 1) { ans *= 3; n--; } if (n > 0) ans *= 4; ans *= pow(mint(5), (n - 2) / 2); } cout << ans << endl; getchar(); getchar(); }