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;

typedef long long ll;
const ll xxx=2.25e8+10,mod=1e9+7;
ll s,res;
char digit[xxx];

inline ll qpow(ll a,ll n){
	ll res=1;
	for(;n;n>>=1,a=a*a%mod)
		if(n&1ll)
			res=res*a%mod;
	return res;
}

int main(){
	cin>>s;
	for(int i=1,j=1;i<xxx;i*=10,++j)
		digit[i]=j;
	for(int i=1;i<xxx;++i)
		if(!digit[i])
			digit[i]=digit[i-1];
	for(int l=1,r=1,now=1;l<10000000;now-=digit[l],++l){
		while(now+digit[r+1]<=s)
			++r,now+=digit[r];
		if(now==s)
			++res;
	}
	for(int i=2;i<=s;++i){
		int l=s/i,r=s%i;
		if(l>=8&&r)
			++res;
	}
	for(int i=8;i<=s>>1;++i)
		if(s/i*i==s)
			res=(res+9*qpow(10,i-1)-s/i+1)%mod;
	if(s>=8)
		res=(res+9*qpow(10,s-1))%mod;
	res%=mod;
	res=(res%mod+mod)%mod;
	cout<<res<<endl;
	return 0;
}