#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define all(x) (x).begin(), (x).end() #define int long long using ll = long long; using namespace std; using P = pair; constexpr int MOD = (int)1e9 + 7; constexpr int INF = 1LL << 50; template bool chmin(T &a, T b) { if (a > b) { a = b; return true; } else { return false; } } template bool chmax(T &a, T b) { if (a < b) { a = b; return true; } else { return false; } } struct Setup { Setup() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); } } SETUP; int modpow(const int n, const int p, const int mod) { if (p <= 0) return 1; if (p % 2 == 0) { const int t = modpow(n, p / 2, mod) % mod; return (t * t) % mod; } else { return (n % mod) * (modpow(n, p - 1, mod) % mod); } } int modinv(int a, const int mod) { int b = mod, u = 1, v = 0; while (b) { int t = a / b; a -= t * b; std::swap(a, b); u -= t * v; std::swap(u, v); } u %= mod; if (u < 0) u += mod; return u; } signed main() { int n; cin >> n; int a = modpow(10, n, MOD); a = 4 * a % MOD - 1; int ans = a * modinv(3, MOD) % MOD; cout << ans << endl; }