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 <cstdio>
typedef long long ll;

const int P=1000000007;
int n,f[23000005],Ans;

ll Pow(ll a,ll b,ll s=1){for(;b;b>>=1,a=a*a%P)if(b&1)s=s*a%P;return s%P;}

int main()
{
    scanf("%d",&n);
    for(int i=1;i<=23000000;++i)f[i]=f[i/10]+1;
    for(int i=1,j=1,s=0;i<10000000;++i)
    {
        while(s<n)s+=f[j++];
        Ans+=s==n,s-=f[i];
    }
    for(int i=1;i<=n/8;++i)
        if(n%i)++Ans;
        else Ans=(Ans+9*Pow(10,n/i-1)-i+1+P)%P;
    printf("%d\n",(Ans+P)%P);
    return 0;
}