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;

long long MOD = 1000000007;

long long Calc(long long A, long long B) {
	if (B == 0) return 1;
	if (B % 2 == 0) {
		long long C = Calc(A, B / 2);
		return (C * C) % MOD;
	}
	return (A * Calc(A, B - 1)) % MOD;
}

long long GCD(long long A, long long B) {
	return (B == 0 ? A : GCD(B, A % B));
}

int main() {
	long long S, ANS = 0;
	cin >> S;
	long long R = 0, SUM = 0, LD = 0, RD = 0, LM = 1, RM = 1;
	for (int L = 1; L < 100000000; L++) {
		if (L == LM) LD++, LM *= 10;
		while (SUM < S) {
			R++;
			if (R == RM) RD++, RM *= 10;
			SUM += RD;
		}
		if (SUM == S) ANS++;
		SUM -= LD;
	}
	ANS %= MOD;
	for (int i = 1; i * 9 <= S; i++) {
		long long D = S / i;
		if (S % i == 0) {
			ANS += 9 * Calc(10, D - 1) - i + 1 + MOD;
		}
		else {
			ANS++;
		}
	}
	cout << ANS % MOD << endl;
}