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 <iostream>

#define ll long long
#define mod 1000000007
using namespace std;

ll pw(ll x,ll a){
	ll ans = 1;
	while(a){
		while(!(a&1)){
			a >>= 1;
			x = (x*x)%mod;
		}
		ans = (ans*x)%mod;
		--a;
	}
	return ans;
}

int dig(ll n){
    int res=0;
    while(n){
        res++;
    	n/=10;
    }
    return res;
}

int main(){
	ll i,s,ans=0;
	cin >> s;
	ll r = 0,l = 0,cnt = 0;
   	while(l<10000000){
		while(cnt<s){
			r++;
			cnt += dig(r);
            if(cnt==s) ans++;
			ans %= mod;
        }
        while(cnt>=s){
            l++;
        	cnt -= dig(l);
            if(cnt==s && l<10000000) ans++;
        }       
    }
	
	ans += (s-1)/8;
	ans %= mod;
	for(i=1;i*i<=s;i++){
		if(!(s%i)){
			if(i>=8){
				(ans += 9*pw(10,i-1) - s/i + mod)%mod;
			}
			if(s/i>=8 && i*i!=s){
				(ans += 9*pw(10,s/i-1) - i + mod)%mod;
			}
		}
	}
	cout << ans%mod << endl;
}