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 For(i, j, k) for(int i = j; i <= k; i++)

using namespace std;

typedef long long LL;

const int N = 3e7 + 10;
const int Mod = 1e9 + 7;

int Pow(int x, int e){
	int ret = 1;
	while(e){
		if(e & 1) ret = 1ll * ret * x % Mod;
		x = 1ll * x * x % Mod;
		e >>= 1;
	}
	return ret;
}

int S;
int sum[N];

int main(){

	scanf("%d", &S);

	For(i, 1, N - 5) sum[i] = sum[i / 10] + 1;
	For(i, 1, N - 5) sum[i] += sum[i - 1];

	int ans = 0, l = 0;
	For(r, 1, N - 5){
		while(l < 9999998 && sum[r] - sum[l] > S) ++l;
		ans += sum[r] - sum[l] == S;
	}
	ans += S / 8;
	
	for(int i = 1; i * i <= S; ++i)
		if(S % i == 0){
			if(i > 7) ans = (ans + Mod + 9ll * Pow(10, i - 1) - S / i) % Mod;
			if(i * i != S && S / i > 7) ans = (ans + Mod + 9ll * Pow(10, S / i - 1) - i) % Mod;
		}
	printf("%d\n", ans);

	return 0;
}