#include using namespace std; typedef long long ll; ll mod=1000000007; ll beki(ll n,ll k){ ll ret=1; ll now=n; while(k>0){ if(k%2==1){ ret*=now; ret%=mod; } now=now*now; now%=mod; k/=2; } return ret; } int main(){ ll n;cin>>n; ll u=beki(10,n); ll t=beki(3,mod-2); t=(t*(u-1))%mod; cout<<(u+t)%mod<