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<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<math.h>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;
using namespace std;
ll Pow10mod(ll a){
	ll x=10,ans=9;
	while(a){
		if(a%2==1)ans=ans*x%mod;
		a/=2;
		x=x*x%mod;
	}
	return ans;
}
ll L10[10];
int main(){
	L10[0]=1;
	lol(i,9)L10[i+1]=L10[i]*10;
	ll s;cin>>s;
	ll ans=0;
	ll left=1,leftdig=1,right=1,rightdig=1,cnt=1;
	while(leftdig<8){
		while(cnt<s){
			right++;if(right==L10[rightdig])rightdig++;
			cnt+=rightdig;
		}
		if(cnt==s)ans++;
		cnt-=leftdig;
		left++;if(left==L10[leftdig])leftdig++;
	}
	for(ll x=1;s/x>=8;x++){
		if(s%x==0){
			ans+=Pow10mod(s/x-1)-x+1;
			ans%=mod;
		}
		else ans++,ans%=mod;
	}
	if(ans<0)ans+=mod;
	cout<<ans<<endl;
	return 0;
}