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<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
#define mod 1000000007 
#define MN 23000000
#define MM 10000000
using namespace std;
inline int in(){
    int x=0;bool f=0; char c;
    for (;(c=getchar())<'0'||c>'9';f=c=='-');
    for (x=c-'0';(c=getchar())>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0');
    return f?-x:x;
}
int num[MN+5],sum,n,res;
inline int qpow(int x,int k){
	int bas=1;while (k){
		if (k&1) bas=(1ll*bas*x)%mod;
		x=(1ll*x*x)%mod;k>>=1;
	}return bas;
}
int main()
{
	n=in();
	for (int i=1;i<=MN;++i) num[i]=num[i/10]+1;
	for (int hd=1,tl=0;hd<MM;++hd){
		while (sum<n) ++tl,sum+=num[tl];
		if (sum==n) ++res;sum-=num[hd];
	}
	for (int i=1;i<=(n>>3);++i){
		res=(res+1)%mod;
		if (!(n%i)) res=(res+1ll*(qpow(10,n/i)+mod-qpow(10,n/i-1))%mod+mod-i)%mod;
	}printf("%d",res);return 0;
}