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;

#define LL long long
#define N 32000000

const LL mod=1000000007;
LL n,ans,d[N];

void upd(LL &x,LL k){x=((x+k)%mod+mod)%mod;}

LL pw(LL x,LL k){
	if (k==0) return 1;
	LL tmp=pw(x*x%mod,k>>1);
	return k&1?tmp*x%mod:tmp;
}

int main(){
	scanf("%lld",&n);
	for (LL i=1;i<=3e7;++i) d[i]=d[i/10]+1;
	for (LL l=1,r=0,s=0;l<1e7;++l){
		for (;s<n;s+=d[++r]);
		if (s==n) upd(ans,1);
		s-=d[l];
	}
	for (LL i=1;i<=n/8;++i)
		if (n%i==0) upd(ans,pw(10,n/i)-pw(10,n/i-1)-i+1);
		else upd(ans,1);
	printf("%lld\n",ans);
	
	return 0;
}