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 int M=1e9+7;
int S,ans;
int len(int x){
	return (int)log10(x)+1;
}
int ksm(int x,int y){
	int ans=1;
	for (;y;y>>=1,x=(ll)x*x%M)
		if (y&1)ans=(ll)ans*x%M;
	return ans;
}
signed main(){
	scanf("%d",&S);
	int sum=0;long long ans=0;
	for (int i=1,j=1;i<1e7;i++){
		if (i!=1)sum-=len(i-1);
		while (sum<S)sum+=len(j),j++;
		if (sum==S)ans++;
	}
	for (int i=8,nowcnt=90000000;i<=S;i++,nowcnt=10ll*nowcnt%M)
		ans+=(S-1)/i-S/(i+1);
	for (int i=1;i*i<=S;i++)
		if (S%i==0){
			if (i>7)ans+=9ll*ksm(10,i-1)-S/i+1;
			if (i*i!=S&&S/i>7)ans+=9ll*ksm(10,S/i-1)-i+1;
		}
	printf("%lld\n",(ans%M+M)%M);
}