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>
#define l1 10000000
#define l2 25500000
#define mod 1000000007
using namespace std;
int s,f[l2+5];
long long quickpow(long long a,long long b){
	long long ret=1;
	for(; b; a=a*a%mod,b>>=1)
		(b&1)&&(ret=ret*a%mod);
	return ret;
}
int count1(){
	int ret=0,r=0,cnt=0;
	for(int i=0; ++i<l1; ){
		for(cnt-=f[i-1]; cnt+f[r+1]<=s&&r<l2; cnt+=f[++r]);
		cnt==s&&(++ret);
		if(r==l2)
			return ret;
	}
	return ret;
}
int count2(int n){
	int lim=n>>3,ret=lim;
	for(int t=0; ++t<=lim; !(n%t)&&(ret=(ret+quickpow(10,n/t-1)*9-t)%mod));
	return ret;
}
int main(){
	for(int i=1,r=10,cnt=1; i<l1; i=r,r*=10,++cnt)
		for(int j=i-1; ++j<r; f[j]=cnt);
	for(int i=l1-1; ++i<=l2; f[i]=8);
	scanf("%d",&s);
	printf("%d\n",((count1()+count2(s))%mod+mod)%mod);
	return 0;
}