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 l1 10000000
#define l2 22500000
using namespace std;
typedef long long ll;
const ll ms=1e9+7;
int f[l2+5];
void pre(){
	int l=1,r=10;
	for (int k=1;k<=7;k++){
		for (int i=l;i<r;i++) f[i]=k;
		l=r; r*=10;
	}
	for (int i=l1;i<=l2;i++) f[i]=8;
}
ll ksm(ll x,ll k){
	ll t=1;
	for (;k;k>>=1){
		if (k&1) t=(t*x)%ms;
		x=(x*x)%ms;
	}
	return t;
}
ll calc1(ll n){
	int l=1,r=1,t=0; ll sum=0;
	while (1){
		while (r<=l2&&sum<n) sum+=f[r++];
		if (sum<n) break;
		if (sum==n) (t+=1)%=ms;
		sum-=f[l++];
		if (l==l1) break;
	}
	return t;
}
ll calc2(ll n){
	ll u=n/8;
	ll ans=u; 
	for (int i=1;i<=u;i++){
		if (n%i==0){
			int len=n/i;
			ll s=9*ksm(10,len-1)%ms;
			(s+=ms-i)%=ms;
			ans+=s; if (ans>=ms) ans-=ms;
		}
	}
	return ans;
}
int main(){
	ll n;
	scanf("%lld",&n);
	pre();
	ll ans=calc1(n)+calc2(n);
	if (ans>=ms) ans-=ms;
	printf("%lld\n",ans);
	return 0;
}