#include #ifndef LOCAL_ #define fprintf if( false ) fprintf #endif // LOCAL_ #define dump() fprintf(stderr, "#%s.%d\n", __func__, __LINE__); #define dumpl(x1) fprintf(stderr, "#%s.%d (%s) = (%ld)\n", __func__, __LINE__, #x1, x1); #define dumpll(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%ld, %ld)\n", __func__, __LINE__, #x1, #x2, x1, x2); #define dumplll(x1, x2, x3) fprintf(stderr, "#%s.%d (%s, %s, %s) = (%ld, %ld, %ld)\n", __func__, __LINE__, #x1, #x2, #x3, x1, x2, x3); #define dumpd(x1) fprintf(stderr, "#%s.%d (%s) = (%lf)\n", __func__, __LINE__, #x1, x1); #define dumpdd(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%lf, %lf)\n", __func__, __LINE__, #x1, #x2, x1, x2); #define loop for(;;) typedef std::vector LI; typedef std::queue QI; #define rep(i,n) for(long i = 0; i < (long)n; ++i) const double pi = M_PI; const long mod = 1000000007; template void scan1(T& x) { fprintf(stderr, "unknown type\n"); } template<> void scan1(long& x) { if( scanf("%ld", &x) < 0 ) exit(0); } template<> void scan1(std::string& x) { if( not ( std::cin >> x ) ) exit(0); } void scan() {} template void scan(Head& x, Tail&... xs) { scan1(x); scan(xs...); } long modpow(long x, long n) { if( n == 0 ) return 1; long t = x * x % mod; return modpow(t, n / 2) * (n % 2 == 1 ? x : 1) % mod; } struct Solver { Solver() { fprintf(stderr, "--------Solver begin--------\n"); } ~Solver() { fprintf(stderr, "--------Solver end--------\n"); } void solve() { long n; scan(n); if( n == 1 ) { puts("2"); return; } long res = n % 2 == 1 ? 3 : 1; res = res * modpow(5, n / 2 - 1) % mod; // for(long i = 0; i < n / 2 - 1; ++i) res = (res * 5) % mod; if( n >= 2 ) res = (res * 4) % mod; printf("%ld\n", res); } }; int main() { loop std::unique_ptr(new Solver())->solve(); }