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<algorithm>
using namespace std;
long long Mod = 1000000007, res, po[11];
long long Pow(long long a, long long b) {
	long long r = 1;
	while (b) {
		if (b & 1)r = r*a%Mod;
		a = a*a%Mod;
		b >>= 1;
	}
	return r;
}
int S[25100000];
int main() {
	int n, i, j, k;
	po[0] = 1;
	for (i = 0; i < 10; i++)po[i + 1] = po[i] * 10;
	scanf("%d", &n);
	int M = n / 8;
	for (i = 1; i <= M; i++) {
		int t = n / i;
		if (t*i != n) res=(res+1)%Mod;
		else {
			res = (res + 9*Pow(10, t - 1) - i + 1 + Mod)%Mod;
		}
	}
	int pv = 0, pp = 0;
	for (i = 1; i <= 25000000; i++) {
		S[i] = S[i - 1];
		if (po[pv] <= i)pv++;
		S[i] += pv;
		while (S[i] - S[pp] > n)pp++;
		if (S[i] - S[pp] == n && pp < 9999999)res++;
	}
	res %= Mod;
	printf("%lld\n", res);
}