#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#define r register
typedef long long ll;
const int mod=1e9+7;
const int maxn=23000000;
inline ll qpow(ll a,ll b){
	ll res=1;
	while(b){
		if(b&1)res=res*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return res%mod;
}
inline int read(){
	register int x=0,f=1;register char ch=getchar();
	for(;!isdigit(ch);f=ch=='-'?-1:1,ch=getchar());
	for(;isdigit(ch);x=(x<<3)+(x<<1)+(ch^48),ch=getchar());
	return x*f;
}
int buf[15];
inline void write(int x){
	register int cnt=0;
	while(x)buf[++cnt]=x%10+48,x/=10;
	while(cnt)putchar(buf[cnt--]);
	puts("");
}
int base[maxn];
int main(){
    r int n=read(),ans=0;
	for(r int i=1;i<=maxn;i++)base[i]=base[i/10]+1;
    for(r int i=1,j=1,s=0;i<1e7;i++){
        while(s<n)s+=base[j++];
        if(s==n)ans=(ans+1)%mod;
        s-=base[i];
    }
    for(int i=1;i<=(n>>3);i++){
        if(n%i)ans=(ans+1)%mod;
        else ans=(ans+(qpow(10,n/i)-qpow(10,n/i-1)-i+1+mod)%mod)%mod;
    }
    write(ans);
    return 0;  
}
### Prompt

In cpp, your task is to solve the following 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

### Response

```cpp
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#define r register
typedef long long ll;
const int mod=1e9+7;
const int maxn=23000000;
inline ll qpow(ll a,ll b){
	ll res=1;
	while(b){
		if(b&1)res=res*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return res%mod;
}
inline int read(){
	register int x=0,f=1;register char ch=getchar();
	for(;!isdigit(ch);f=ch=='-'?-1:1,ch=getchar());
	for(;isdigit(ch);x=(x<<3)+(x<<1)+(ch^48),ch=getchar());
	return x*f;
}
int buf[15];
inline void write(int x){
	register int cnt=0;
	while(x)buf[++cnt]=x%10+48,x/=10;
	while(cnt)putchar(buf[cnt--]);
	puts("");
}
int base[maxn];
int main(){
    r int n=read(),ans=0;
	for(r int i=1;i<=maxn;i++)base[i]=base[i/10]+1;
    for(r int i=1,j=1,s=0;i<1e7;i++){
        while(s<n)s+=base[j++];
        if(s==n)ans=(ans+1)%mod;
        s-=base[i];
    }
    for(int i=1;i<=(n>>3);i++){
        if(n%i)ans=(ans+1)%mod;
        else ans=(ans+(qpow(10,n/i)-qpow(10,n/i-1)-i+1+mod)%mod)%mod;
    }
    write(ans);
    return 0;  
}
```