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;

using ll = long long;

constexpr int mod = 1e9+7;

ll pw(ll a, int n)
{
    if(!n) return 1;
    if(n&1) return a*pw(a,n-1)%mod;
    return pw(a*a%mod,n/2);
}

int main()
{
    int s;
    long long ans=0;
    scanf("%d",&s);
    for(int i=1;i<=s;i++)
    {
        int l = s/i, r = (s+i-1)/i;
        if(r<9) break;
        int b = s-l*i, a = i-b;
        if(b) ans++;
        else ans = (ans + mod + pw(10,l-1)*9%mod - a + 1)%mod;
    }
    int cur=0, l=1, ls=1,rs=1, ln=10,rn=10;
    for(int r=1;r<100000000;r++)
    {
        if(r == rn)
        {
            rn *= 10;
            rs++;
        }
        cur += rs;
        while(cur>s)
        {
            cur -= ls;
            l++;
            if(l == ln)
            {
                ln *= 10;
                ls++;
            }
        }
        ans += s == cur;
    }
    printf("%lld\n",ans%mod);
}