#include using namespace std; const int MOD = int(1e9) + 7; long long N; int main() { ios::sync_with_stdio(false); cin >> N; if (N == 1) { cout << 2 << endl; } else { int ans = 4; for (int i = 1; i < N / 2; ++i) { ans = 5LL * ans % MOD; } if (N & 1) { ans = 3LL * ans % MOD; } cout << ans << endl; } return 0; }