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;
int A[23000000]; 
long long MOD = 1000000007; 
long long power(long long a, int n){
	long long ans = 1; long long mul = a;
	while(n){
		if(n & 1){
			ans *= mul; ans %= MOD;
		}
		n >>= 1;
		mul = mul * mul % MOD;
	}
	return ans;
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int S; cin >> S;
	long long ans = 0;
	for(int i = 1; i < 10; i++) A[i] = 1;
	for(int i = 10; i < 100; i++) A[i] = 2;
	for(int i = 100; i < 1000; i++) A[i] = 3;
	for(int i = 1000; i < 10000; i++) A[i] = 4;
	for(int i = 10000; i < 100000; i++) A[i] = 5; 
	for(int i = 100000; i < 1000000; i++) A[i] = 6;
	for(int i = 1000000; i < 10000000; i++) A[i] = 7;
	for(int i = 10000000; i < 23000000; i++) A[i] = 8;
	int now = 0; int r = 0; 
	for(int i = 1; i < 10000000; i++){
		while(now < S){
			r++; now += A[r]; 
		}
		if(now == S) ans ++; 
		now -= A[i]; 
	}
	vector<int> div; 
	for(int i = 1; i * i <= S; i++){
		if(S % i != 0) continue; 
		div.push_back(i); 
		if(i * i != S) div.push_back(S/i); 
	}
	for(int i : div){
		if(i < 8) continue; 
		long long tmp = (MOD + power(10, i - 1) * 9 + 1 - S/i) % MOD; 
		ans += tmp; ans %= MOD; 
	}
	long long add = 0; 
	for(int d = 8; d <= S; d++){
		int mx = S / d - S % d; 
		if(mx <= 0) continue; 
		int tmp = mx / (d+1) + 1; 
		if(S % (d+1) == 0) tmp--; 
		if(S % d == 0) tmp --; 
		add += tmp; 
	}
	add %= MOD; 
	ans += add; ans %= MOD; 
	cout << ans << "\n"; 
}