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>
#define rep(i, s, t) for(i = s; i <= t; ++i)
 
const int P = 1e9 + 7;
 
typedef long long LL;
int n, ans;
 
inline int calc(int x) {
	if(x < 10) return 1;
	if(x < 100) return 2;
	if(x < 1000) return 3;
	if(x < 10000) return 4;
	if(x < 100000) return 5;
	if(x < 1000000) return 6;
	if(x < 10000000) return 7;
	return 8;
}
 
int lp(int a, int b) {
	int ret = 1;
	for(; b; b >>= 1, a = (LL)a * a % P)
		if(b & 1) ret = (LL)ret * a % P;
	return ret;
}
 
int main() {
	int i, l, r, t;
	scanf("%d", &n);
	rep(i, 1, n / 8) {
		if(!(n%i)) ans = (ans + 9ll*lp(10,n/i-1)%P - i + 1 + P) % P;
		else ++ans;
	}
	t = 0;
	for(l = 1, r = 1; calc(l) <= 7; ++l) {
		for(; t < n; ++r) t = t + calc(r);
		if(t == n) ++ans;
		t -= calc(l);
	}
	printf("%d\n", ans % P);
	return 0;
}