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>

const int P = 1000000007;

int f(int x, int y) {
	return y ? y & 1 ? (long long)f(x, y ^ 1) * x % P : f((long long)x * x % P, y >> 1) : 1;
}

int main() {
	int L, Lf, Lt, R, Rf, Rt, S;
	int i, n, res = 0;
	scanf("%d", &n);
	L = Lf = R = Rf = 1;
	S = 0;
	Lt = Rt = 10;
	while (1) {
		if (R >= Rt) {
			Rf++;
			Rt *= 10;
		}
		R++;
		S += Rf;
		while (S > n) {
			if (L >= Lt) {
				Lf++;
				Lt *= 10;
			}
			L++;
			S -= Lf;
		}
		if (L >= 10000000) break;
		if (S == n) {
			res++;
			if (L >= Lt) {
				Lf++;
				Lt *= 10;
			}
			L++;
			S -= Lf;
		}
	}
	for (i = R - L; i; i--) {
		if (n % i) res++;
		else {
			res = (res + 9LL * f(10, n / i - 1) - (i - 1) + P) % P;
		}
	}
	printf("%d\n", res % P);
}