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>
#include<iostream>
#include<algorithm>
#include<ctime>
#include<cstdlib>
#include<sys/time.h>
#include<cstring>
#include<cmath>
using namespace std;
typedef long long ll;
inline int ri()
{
	register int x=0;register bool f=0;register char ch=getchar();
	while(ch>'9'||ch<'0'){if(ch=='-')f=1;ch=getchar();}
	while(ch<='9'&&ch>='0'){x=x*10+ch-'0';ch=getchar();};
	return f?-x:x;
}
void wi(int x)
{
	if(x<0)	x=-x,putchar('-');
	if(x>9)	wi(x/10);
	putchar('0'+x%10);
}
const int mod=1e9+7,N=23000000;
int dig[N+5];
inline void add(int &x,int y)
{
    x+=y;
    if(x>=mod) x-=mod;
}
ll modpow(ll a,int b)
{
    ll res=1;
    for(;b;b>>=1,a=a*a%mod)
        if(b&1) res=res*a%mod;
    return res;
}
int main()
{
    int n=ri(),res=0,i,j,s;
    for(i=1;i<=N;i++) dig[i]=dig[i/10]+1;
    for(i=1,j=1,s=0;i<1e7;i++)
    {
        while(s<n) s+=dig[j],j++;
        if(s==n) add(res,1);
        s-=dig[i];
    }
    for(i=1;i<=n/8;i++)
    {
        if(n%i==0) add(res,((modpow(10,n/i)-modpow(10,n/i-1)-i+1)%mod+mod)%mod);
        else add(res,1);
    }
    printf("%d\n",res);
    return 0;
}