#include using namespace std; #define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i)) using ll = long long; using P = pair; using namespace std; template void vin(vector& v, int n) { v.resize(n); for (int i = 0; i < n; ++i) { cin >> v[i]; } } ll mod_pow(ll x, ll n, ll mod=1e9+7) { ll ret = 1; while (n > 0) { if (n&1) ret = ret * x % mod; x = x * x % mod; n >>= 1; } return ret; } // / a (MOD mod) ll mod_inv(ll a, ll mod=1e9+7) { return mod_pow(a, mod-2, mod); } int main() { const ll mod = 1e9 + 7; ll n; cin >> n; ll ans = mod_pow(10, n); ans = ans * 4 % mod; ans = (ans - 1) % mod; ans = ans * mod_inv(3) % mod; cout << ans << endl; }