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;
typedef long long ll;
const ll MOD = 1e9 + 7;
const int INF = 1 << 30;
ll mod_pow(ll a, ll n) {
	if (n == 0) return 1;
	if (n % 2 == 0) {
		ll tmp = mod_pow(a, n / 2);
		return (tmp * tmp) % MOD;
	}
	return (a * mod_pow(a, n - 1)) % MOD;
}
int main() {
	int S;
	cin >> S;
	int l = 1, r = 1;
	ll sum = 1;
	ll nxtL = 10, nxtR = 10, dL = 1, dR = 1;
	ll ans = 0;
	while (l < 1e8) {
		while (sum < S) {
			r++;
			if (r == nxtR) dR++, nxtR *= 10;
			sum += dR;
		}
		if (sum == S) ans++;
		sum -= dL;
		l++;
		if (l == nxtL) dL++, nxtL *= 10;
	}
	for (int len = 1; len <= S; len++) {
		int k = S / len;
		if (k <= 8) break;
		if (S%len == 0) {
			(ans += 9 * mod_pow(10, k - 1) - len + 1 + MOD) %= MOD;
		}
		else {
			(ans += 1) %= MOD;
		}
	}
	cout << ans << endl;
}