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>
#define LL long long
#define clr(x,i) memset(x,i,sizeof(x))
using namespace std;
const int N=22987653;
const LL mo=1e9+7;
int n,f[N+2];
LL qpow(LL x,LL k)
{
	LL ret=1;
	while(k){
		if(k&1) ret*=x,ret%=mo;
		x*=x; x%=mo; k>>=1;
	}
	return ret;
}
int main()
{
	scanf("%d",&n);
	int kt=1;
	for(int i=1;i<=8;i++){
		int now=min(N,kt*10);
		for(int j=kt;j<now;j++)
		  f[j]=i;
		kt*=10;
	}
	for(int i=1;i<N;i++) f[i]+=f[i-1];
	LL ans=0;
	for(int l=0,r=1;l<10000000-1;l++){
		while(f[r]-f[l]<n) r++;
		if(f[r]-f[l]==n) ans++;
	}
//	cout<<ans<<endl;
	for(int len=1;len<=n/8;len++){
		if(n%len==0)
		  ans=(ans+(9*qpow(10,n/len-1)-len+1)%mo+mo)%mo;
		else
		  ans=(ans+1)%mo;
	}
	printf("%lld\n",ans);
	return 0;
}