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;
 
#define ll long long
#define fi first
#define se second
#define pb push_back
 
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
 
const int mod = 1e9 + 7;
 
ll S, mul = 9, cnt, ans;
int pref[15000005];
bool ck[100000005];
 
ll binpw(ll base, ll pw){
	ll ans = 1;
	while(pw){
		if(pw & 1) ans = (ans * base) % mod;
		base = (base * base) % mod;
		pw >>= 1;
	}
	return ans;
}
 
signed main(){
	ios_base::sync_with_stdio(0);
	cin >> S;
	ck[0] = 1;
	for(int i = 1; i <= 7; i++){
		for(int j = 1; j <= mul; j++){
			++cnt;
			pref[cnt] = pref[cnt - 1] + i;
			ans += (pref[cnt] >= S && ck[pref[cnt] - S]);
			ck[pref[cnt]] = 1;
		}
		mul *= 10;
	}
	//cout << "OK\n";
	int pos = -1;
	int temp = pref[cnt];
	for(int i = 1; temp <= (S + 100000000); i++){
		temp += 8;
		ans += (temp >= S && ck[temp - S]);
	}
	//cout << ans << "\n";
	for(int i = (S - 1) / 8; i >= 1; i--){
		if(!(S % i)){
			ll tmp = S / i, tmp2 = binpw(10, tmp - 1) * 9;
			//cout << tmp << " " << tmp2 % mod << "\n";
			//if(tmp2 < i) continue;
			//cout << ans << " " << tmp2 << "\n";
			ans = (ans + tmp2 - i + 1 + mod) % mod;
		}
		else{
			ans++;
			if(ans >= mod) ans -= mod;
		}
	}
	if(!(S % 8)){
		ans += 90000000 - S / 8;
		//cout << 90000000 - S / 8 + 1 << "\n";
		//if(ans >= mod) ans -= mod;
		if(ans >= mod) ans -= mod;
	}
	cout << ans;
}