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;

using ll = long long;

const int K = 30000000 - 1;
const ll M = ll(1e9) + 7;

int n, s[K + 1];
ll ans;

ll pw(ll n, ll k){
	if(k == 1) return n;
	return pw(n * n % M, k / 2) * (k % 2 ? n : 1) % M;
}

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	cin >> n;
	for(int i = 1, j = 0, k = 1, t = 0; i <= K; i++){
		for(; k <= i; ){ k *= 10; j++; }
		s[i] = s[i - 1] + j;
		for(; s[i] - s[t + 1] >= n; ) t++;
		if(t >= 9999999) break;
		if(s[i] - s[t] == n) ans++;
	}
	ll t = ll(9e7);
	for(int i = 8; i <= n / 100; i++, t = t * 10 % M){
		if(n % i) continue;
		ans = (ans + t - (n / i) + 1 + M) % M;
	}
	for(int i = 1; i <= 99; i++){
		if(n % i) continue;
		if(n / i < 8) continue;
		ans = (ans + 9 * pw(10, n / i - 1) - i + 1 + M) % M;
	}
	for(int i = 8; i <= n / 2; i++){
		int q = n / i, r = n % i;
		if(q > r){
			ans = (ans + (q - r - 1) / (i + 1) + 1) % M;
			if(!r) ans = (ans + M - 1) % M;
		}
	}
	cout << ans << endl;
}