#include #define rep(i,n) for(int i=0;i ; const ll INF = 1e18; const ll MOD = 1000000007; long long modpow(long long a, long long b,long long mod){ bitset<200> bit(b); string s = bit.to_string(); long long ret = 1; for (int i = 0;i< s.length(); ++i){ ret = (ret * ret) % mod; if(s[i]-'0') ret = (ret * a) % mod; } return ret; } long long inverse(long long x,long long mod){ return modpow(x,mod-2,mod); } int main(){ ll n; cin >> n; ll ans = ((4*modpow(10LL,n,MOD))%MOD - 1 + MOD)%MOD; ans = (ans * inverse(3LL,MOD))%MOD; cout << ans << endl; return 0; }