#include using namespace std; typedef long long ll; #define REP(i,n) for(int i=0; i #define VLL vector #define VVI vector> #define VVLL vector> #define VC vector #define VS vector #define VVC vector> #define VB vector #define VVB vector> #define fore(i,a) for(auto &i:a) typedef pair P; template bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } const int INF = 1 << 29; const ll INFL = 1LL << 60; const ll mod = 1000000007; long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } ll pow_mod(ll n, ll k, ll m) { ll r = 1; for (; k > 0; k >>= 1) { if (k & 1)r = (r*n) % m; n = (n*n) % m; } return r; } int main() { ll n; cin >> n; ll ans = pow_mod(10, n, mod); ll a = ans - 1; a *= 3; a += mod; a %= mod; a *= modinv(9, mod); ans += a; ans %= mod; cout << ans << endl; }