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<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#define maxn 22500000
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
int f[maxn+5];
void init()
{
	int l=1,r=10;
	for(int i=1;i<=7;i++)
	{
		for(int j=l;j<=r-1;j++)
			f[j]=i;
		l*=10; r*=10;
	}
	for(int i=l;i<=maxn;i++)
		f[i]=8;
}
ll s;
ll solve1()
{
	int l=1,r=0;
	ll res=0,now=0;
	while(l<10000000)
	{
		while(r<maxn &&  now<s)
			r++,now+=f[r];
		if(now==s)
			(res=(res+1)%mod);
		now-=f[l];
		l++;
	}
//	cerr<<res<<endl;
	return res;
}
ll quickpow(ll p,ll k)
{
	ll ans=1;
	while(k)
	{
		if(k&1)
			ans=(ans*p)%mod;
		p=(p*p)%mod;
		k>>=1;
	}
	return ans;
}
ll solve2()
{
	ll maxx=s/8,res=maxx;
	for(int i=1;i<=maxx;i++)
	{
		if(s%i==0)
		{
			int len=s/i;
			ll temp=9ll*quickpow(10,len-1)%mod;
			temp=(temp+mod-i)%mod;
			res=(res+temp)%mod;
		}
	}
	return res;
}
int main()
{
	init();
	scanf("%lld",&s);
	printf("%lld\n",(solve1()+solve2())%mod);
}