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;

typedef long long ll;

const ll MOD = 1000000007;

ll modpow(ll x,ll k){
	if(k == 0)return 1;
	ll ret = modpow(x,k/2);
	ret *= ret; ret %= MOD;
	if(k%2 == 1){
		ret *= x;
		ret %= MOD;
	}
	return ret;
}

vector<ll> div(ll n){
	vector<ll> ret;
	ret.push_back(1);
	for(int i = 2 ; n != 1 ; i ++){
		if(n%i == 0){
			int cnt = 0;
			do {
				n /= i;
				cnt ++;
			}while(n%i == 0);
			int sz = ret.size();
			for(int j = 0 ; j < sz ; j ++){
				ll t = ret[j];
				for(int k=0;k<cnt;k++){
					t*=i;
					ret.push_back(t);
				}
			}
		}
	}
	return ret;
}

int main(){
	ll s;
	cin >> s;
	
	ll ret = 0;
	ll l=0,r=1,sum=0;
	ll x=0,y=1;
	ll POW[12];
	POW[0]=1;
	for(int i=1;i<12;i++){
		POW[i]=POW[i-1]*10;
	}
	while(l+1<POW[7]){
		l++;
		sum-=x;
		if(l==POW[x])x++;
		while(sum<s){
			r++;
			sum+=y;
			if(r==POW[y])y++;
		}
		if(sum==s)ret++;
	}
	
	vector<ll> d=div(s);
	for(ll x: d){
		if(x<=s/8)ret--;
		if(x>=8)ret+=9*modpow(10,x-1)+MOD-(s/x)+1;
	}
	ret+=s/8;
	cout<<ret%MOD<<endl;
}