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<bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define st first
#define nd second
typedef pair < int , int > pp;
const int mod = 1e9 + 7;
const int N   = 1e8 + 8;

char A[N];
int k,i,j,t,mo,ans,bas,hed;
long long zz;

signed main(){
    cin >> k;
    zz = 100000000;

    hed = 10;
    for(bas=i=j=1;i<zz;i++){
        if(i == hed){
            hed *= 10;
            bas++;
        }

        t += bas;
        for(; j < i && t > k; j++) t -= A[j];
        if(t == k) ans++;
        A[i] = bas;
    }

    zz *= 9;
    for(i=9;i<=k;i++){
        t = k/i;
        mo = k%(i-1);
        ans += max(0 , (t-mo)/(i-1) + (mo>0 && t >= mo));
        if(ans > mod) ans -= mod; 
        if(k % i == 0){
            ans += zz - t;
            if(ans > mod) ans -= mod; 
        }
        
        zz = zz * 10 % mod;
    }
    
    cout << ans;
    return 0;
}