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 MOD=1e9+7;

int p10[11];
int main(){
        p10[0]=1;
        for(int i=1;i<=10;i++) p10[i]=p10[i-1]*10;

        int sum;
        cin>>sum;

        long long ans=0;
        ///maybe more than 3
        for(int L=1,R=1,vL=1,vR=1,csum=0;R<p10[8];R++){
                if (R==p10[vR]) vR++;
                csum+=vR;
                while (csum>sum){
                        if (L==p10[vL]) vL++;
                        csum-=vL;
                        L++;
                }
                ans+=sum==csum;
//                if (sum==csum) cout<<L<<" "<<R<<'\n';
        }

        ///case that we use 2 number(the later >=9) ((a+b)x==sum+b) (x<=9*10**7)
        for(int x=9;x<=sum;x++){
                int R=(sum-1)/(x-1)-1;
                int L=x-(sum%x);
                if (R>=L){
//                        cout<<x<<" "<<L<<" "<<R<<" "<<(R-L)/x+1<<'\n';
                        ans=(ans+(R-L)/x+1)%MOD;
                }
        }
//        cout<<ans<<'\n';
        ///only 1 num start from 8
        for(int x=9,cp10=p10[8];x<=sum;x++,cp10=cp10*10LL%MOD) if (sum%x==0){
                int len=sum/x;
//                cout<<x<<" "<<len<<" "<<cp10<<'\n';
                ans=(ans+9LL*cp10-len+1)%MOD;
        }
        cout<<(ans+MOD)%MOD;
}