#include #include #define ft first #define sc second #define pt(sth) cout << sth << "\n" #define chmax(a, b) (a)=max(a, b) #define chmin(a, b) (a)=min(a, b) #define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD using namespace std; typedef long long ll; typedef pair pll; static const ll INF=1e18; static const ll MAX=101010; static const ll MOD=1e9+7; /* for(i=0; i> a[i]; */ ll moP(ll x, ll n) { ll res=1; while(n>0) { if(n&1) moC(res, *, x); moC(x, *, x); n>>=1; } return res; } ll f(ll n) { if(n==0) return 0; ll res=0; if(n&1) moC(res, +, moP(10, n-1)); ll t=f(n/2); moC(res, +, (moP(10, n/2)*t+t)%MOD); return res; } int main(void) { ll i, j, k; ll N; cin >> N; ll ans=(moP(10, N)+f(N)*3)%MOD; pt(ans); }