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<cstdio>
#define N 23000000
#define mod 1000000007
#define ll long long
using namespace std;
int num[N+5];
ll n;
ll ans;
void insert(){
	scanf("%d",&n);
	for(int i=1;i<=N;i++){
		num[i]=num[i/10]+1;
	}
}
void add_ans(ll x){
	ans=(ans+x)%mod;
}
void digit_8down(){
	int j=1;
	int sum=0;
	for(int i=1;i<1e7;i++){
		while(sum<n&&j<=N){
			sum+=num[j];
			j++;
		}
		if(sum==n)add_ans(1);
		sum-=num[i];
	}
}
ll summod(ll digit){ 
	ll sum=1;
	ll i=10;
	while(digit!=0){
		if(digit&1)sum=(sum*i)%mod;
		i=(i*i)%mod;
		digit>>=1;
	}
	return sum;
}
void digit_8up(){
	for(ll i=1;i<=n/8;i++){
		if(n%i==0){
			add_ans(((summod(n/i)-summod(n/i-1)-i+1)%mod+mod)%mod);//100-1000-->(3--4)-->900 
		}
		else{
			add_ans(1);
		}
	}
}
int main(){
	insert();
	digit_8down();
	digit_8up();
	cout<<ans;
}