#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; 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; for(int i = 1; i < 100000; i++){ base = (base*10 + 1)%MOD; } ll ans = 0; if(x <= 100000){ ans = 1; } while(x > 100000){ x -= 100000; ans = (ans * 10000 + base)%MOD; } ll tmp; for(int i = 0; i < x; i++){ tmp = ans; ans = (ans*10 + 1)%MOD; } cout << (ans + (tmp + z)*2)%MOD << endl; return 0; }