#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++I) #define CLR(mat) memset(mat, 0, sizeof(mat)) typedef long long ll; const int mod = 1e9 + 7; int main() { ll N; cin >> N; if(N == 1) { cout << 2 << endl; return 0; } ll ans = 0; if(N % 2 == 1) ans += 3; else ans = 1; // 5^(N/2-1)を高速に計算 ll j = 0; ll fi = 5; ll p = N / 2 - 1; while((1<>j)&1) { ans *= fi; ans %= mod; } fi *= fi; fi %= mod; j++; } ans *= 4; cout << ans % mod << endl; }