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 "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

long long int power(long long int x, long long int n, long long int M) {
	long long int tmp = 1;

	if (n > 0) {
		tmp = power(x, n / 2, M);
		if (n % 2 == 0) tmp = (tmp*tmp) % M;
		else tmp = (((tmp*tmp) % M)*x) % M;
	}
	return tmp;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N;

	vector<int>v(30000001);
	for (int i = 1; i <= 10000000; i *= 10) {
		v[i]++;
	}
	for (int i = 2; i <= 30000000; i++) {
		v[i] += v[i - 1];
	}
	for (int i = 2; i <= 30000000; i++) {
		v[i] += v[i - 1];
	}
	L = 1;
	R = 1;
	while (R <= 30000000) {
		if (v[R] - v[L - 1] >= N) {
			if (v[R] - v[L - 1] == N) {
				K++;
			}
			L++;
		}
		else {
			R++;
		}
		if (N % 8 == 0 && L == 10000000) {
			break;
		}
	}
	for (int i = 1; i <= N / 8; i++) {
		if (N%i == 0) {
			long long int box = power(10, N / i, MOD);
			box -= power(10, N / i - 1, MOD);
			box -= i - 1;
			box += MOD*2;
			box %= MOD;
			K += box;
			L %= MOD;
		}
		else {
			K++;
		}
	}
	cout << K%MOD << endl;
	return 0;
}