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;
const int mod=1e9+7;
const int N=3e7+10;

int qpow(int a,int b) {
	int ret=1;
	while(b) {
		if(b&1) ret=1ll*ret*a%mod;
		a=1ll*a*a%mod,b>>=1;
	}
	return ret;
}

int S,f[N],ans=0;

int main() {
	cin>>S;
	for(int i=1;i<N;i++) f[i]=f[i/10]+1;
	for(int i=1,j=1,sum=0;i<1e7;i++) {
		while(sum<S) sum+=f[j++];
		if(sum==S) ++ans;
		sum-=f[i];
	}
	for(int i=8;i<=S;i++) {
		if(S%i==0) {
			int cnt=(qpow(10,i)-qpow(10,i-1)+mod)%mod;
			ans=(1ll*ans+cnt-S/i+1+mod)%mod;
		}
		if(i>8) {
			int lo=S/i+1,up=(S-1)/(i-1);
			if(lo<=up) ans=(1ll*ans+up-lo+1+mod)%mod;
		}
	}
	cout<<ans;
	return 0;
}