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;
const int base[9]={1,10,100,1000,10000,100000,1000000,10000000,100000000};
const int mod=1000000007;
int s,nl,nr,now;
inline int ksm(int x,int n) {
    int ret=1;
    while (n) {
        if (n&1) ret=1ll*ret*x%mod;
        n>>=1;
        x=1ll*x*x%mod;
    }
    return ret;
}
int main()
{
    scanf("%d",&s);
    int res=0;
    for (int l=1,r=1;l<10000000;++l) {
        while (now<s&&r<=22499999) {
            if (r>=base[nr]) ++nr;
            now+=nr;
            ++r;
        }
        if (now==s) ++res;
        if (l>=base[nl]) ++nl;
        now-=nl;
    }
    res+=s/8;
    for (int i=1;i<=s/8;++i)
        if (s%i==0)
            res=((res+(ksm(10,s/i)-ksm(10,s/i-1)-i)%mod)%mod+mod)%mod;
    printf("%d\n",res);
    return 0;
}