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>

#define debug(x) cout << #x << " = " << x << endl
#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)
#define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;

const int MOD = 1e9 + 7;
const int MAX = 24000000 + 5;
int digits[MAX];

inline int add(int a, int b) {
	a += b;
	if(a >= MOD) {
		a -= MOD;
	}
	return a;
}

inline int mult(int a, int b) {
	return (1LL * a * b) % MOD;
}

inline int sub(int a, int b) {
	a -= b;
	if(0 > a) {
		a += MOD;
	}
	return a;
}

int f_exp(int x, int exp) {
	if(exp == 0) {
		return 1;
	}
	else if(exp & 1) {
		return mult(x, f_exp(x, exp - 1));
	}
	return f_exp(mult(x, x), exp / 2);
}

int main() {
	ios_base::sync_with_stdio(false);

	int s;
	cin >> s;

	int ans = 0;
	int left = 1, d = 1, p = 1, sum = 0;
	fori(right, 1, 23000000 + 1) {
		if(p * 10 == right) {
			d++;
			p *= 10;
		}

		digits[right] = d;
		sum += digits[right];

		while(sum > s) {
			sum -= digits[left++];
		}

		if(digits[left] > 7) {
			break;
		}

		ans = add(ans, sum == s);
	}

	fori(i, 1, s / 8 + 1) {
		if(s % i == 0) {
			int q = s / i;
			int range_len = sub(f_exp(10, q), f_exp(10, q - 1));
			ans = add(ans, add(sub(range_len, i), 1));
		}
		else {
			ans = add(ans, 1);
		}
	}

	cout << ans << '\n';

	return 0;
}