#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long int ll const MOD = 1000000007; ll const INF = (long long int)1 << 61; ll mypow(ll x,ll t){ ll ret = 1; while(t > 0){ if(t&1){ ret = (ret*x)%MOD; } x = (x*x)%MOD; t >>= 1; } return ret; } int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; ll x = n%(MOD-1); ll y = (((MOD)*(MOD-1))/2)%MOD; ll z = ((((n/(MOD-1))%MOD)*y)%MOD); ll base = 1; ll t = 1; for(int i = 1; i < 100000; i++){ base = (base*10 + 1)%MOD; t++; } ll base2 = base; ll sr = mypow(10,100000); for(int i = 1; i < 100000; i++){ base2 = (base2 * sr + base)%MOD; } ll sr2 = mypow(10,10000000000); ll base3 = base2; for(int i = 1; i < 10000; i++){ base3 = (base3 * sr2 + base2)%MOD; } ll ans = 1; ll sr3 = mypow(10,100000000000000); while(n > 100000000000000){ n -= 100000000000000; ans = (ans * sr3 + base3)%MOD; } while(n > 10000000000){ n-= 10000000000; ans = (ans * sr2 + base2)%MOD; } while(n > 100000){ n -= 100000; ans = (ans * sr + base)%MOD; } ll tmp; for(int i = 0; i < n; i++){ tmp = ans; ans = (ans*10 + 1)%MOD; } cout << (ans + (tmp)*2)%MOD << endl; return 0; }