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<cstdio>
#include<iostream>
using namespace std;
int s,sum,digit[23000005];
long long ans,tmp=1;
inline void init(){
	for(register int i=1;i<=23000000;i++){
		digit[i]=digit[i/10]+1;
	}
}
inline long long quick_pow(long long x,int p,int m){
	long long result=1;
	while(p>0){
		if(p&1==1){
			result*=x;result%=m;
		}
		p=p>>1;
		x*=x;x%=m;
	}
	return result;
}
int main(){
	init();
	scanf("%d",&s);
	for(register int i=1;i<10000000;i++){
		while(sum<s){
			sum+=digit[tmp];
			tmp++;
		}
		if(sum==s){
			ans++;ans%=1000000007;
		}
		sum-=digit[i];
	}
	for(register int i=1;i<=s/8;i++){
		switch(s%i){
			case 0:tmp=quick_pow(10,s/i-1,1000000007)*9-i+1;
				   tmp%=1000000007;tmp=(tmp+1000000007)%1000000007;
				   ans+=tmp;ans%=1000000007;break;
			default:ans++;ans%=1000000007;break;
		}
	}
	printf("%d\n",ans);
	return 0;
}