#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; ll mod = 1e9+7; ll modinv(ll a){ if(a==0) abort(); ll b = mod, u = 1, v = 0; while(b){ ll t = a/b; a -= t * b; swap(a,b); u -= t * v; swap(u,v); } u %= mod; if(u<0) u += mod; return u; } ll modpow(ll a,ll b){ ll ans = 1; a %= mod; while(b){ if(b&1) ans = ans * a % mod; a = a * a % mod; b >>= 1; } return ans; } int main(){ cin.tie(0); ios::sync_with_stdio(0); // 10^N + (10^N - 1) / 3 ll N; cin >> N; cout << (modpow(10, N) + (modpow(10, N) - 1) * modinv(3) % mod) % mod << endl; }