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 ans;
int n, fc[9];
const int MOD = 1e9 + 7;

int Mypow(int x, int y) {
	int c = 1;
	while(y) {
		if(y & 1) c = 1LL * c * x % MOD;
		x = 1LL * x * x % MOD;
		y >>= 1;
	}
	return c;
}

int main(void) {
	scanf("%d", &n);
	for(int i = 8; i <= n; i++) {
		int res = n % i;
		if(!res)
			ans = (ans + 9LL * Mypow(10, i - 1) % MOD - n / i + 1 + MOD + n / i / (i + 1) - (n / i % (i + 1) == 0)) % MOD;
		else if (n > 1LL * res * (i + 1))
			ans = (ans + (n / i - res) / (i + 1) + 1 - ((n / i - res) % (i + 1) == 0)) % MOD; 
	}
	fc[0] = 1;
	for(int i = 1; i <= 8; i++)
		fc[i] = fc[i - 1] * 10;
	for(int l = 1, r = 1, now = 1, add = 1, dec = 1; l <= 9999999; ) {
		if(l > r) {
			r++;
			if(r == fc[add]) add++;
			now += add;
		}
		while(now < n) {
			r++;
			if(r == fc[add]) add++;
			now += add;
		}
		if(now == n) ans++;
		l++;
		now -= dec;
		if(l == fc[dec]) dec++;
		
	}
	printf("%d\n", ans % MOD);
	return 0;
}