Problem: For a positive integer n, let us define f(n) as the number of digits in base 10.

You are given an integer S. Count the number of the pairs of positive integers (l, r) (l \leq r) such that f(l) + f(l + 1) + ... + f(r) = S, and find the count modulo 10^9 + 7.

Constraints

* 1 \leq S \leq 10^8

Input

Input is given from Standard Input in the following format:


S


Output

Print the answer.

Examples

Input

1


Output

9


Input

2


Output

98


Input

123


Output

460191684


Input

36018


Output

966522825


Input

1000


Output

184984484

Solution (in CPP):

Solution:
#include <iostream>

using namespace std;

const long MOD = 1000000007;

long pow10(long n){
    long ans = 1;
    long tmp = 10;
    for(int i = 0; i <= 30; i++){
        int m = (1<<i);
        if(m&n) {
            ans *= tmp;
            ans %= MOD;
        }
        tmp = tmp*tmp;
        tmp %= MOD;
    }
    return ans;
}

int main(){
    long S;
    long ans = 0;
    cin >> S;
    for(long i = 1; i <= S; i++){
        if(S/i < 8) break;
        if(S%i == 0){
            //cout << i << ' ' << S/i << endl;
            long n = S/i;
            if(n == 8) break;
            long tmp = pow10(n-1);
            ans += (10*tmp-tmp-i+1);
            ans %= MOD;
            ans += MOD;
            ans %= MOD;
            //cout << ans << endl;
        }else{
            ans++;
            ans %= MOD;
        }
    }
    
    int l = 1;
    int r = 1;
    long sum = 1;
    long l_tmp = 1;
    long r_tmp = 1;
    long l_next = 10;
    long r_next = 10;
    if(S == 1) ans++;
    
    while(true){
        while(sum <= S){
            r++;
            if(r >= 1e+8){
                cout << ans << endl;
                return 0;
            }
            if(r >= r_next){
                r_next*=10;
                r_tmp++;
            }
            sum += r_tmp;
            if(sum == S) {
                //cout << l << ' ' << r << endl;
                ans++;
                ans %= MOD;
            }
        }
        while(sum >= S){
            l++;
            sum -= l_tmp;
            if(l >= l_next){
                l_next*=10;
                l_tmp++;
            }
            if(sum == S) {
                //cout << l << ' ' << r << endl;
                ans++;
                ans %= MOD;
            }
        }
    }
    cout << ans << endl;
}