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 int sign;
typedef long long ll;
#define For(i,a,b) for(register sign i=(sign)(a);i<=(sign)(b);++i)
#define Fordown(i,a,b) for(register sign i=(sign)(a);i>=(sign)(b);--i)
const int N=2e7+3e6+5;
template<typename T>bool cmax(T &a,T b){return (a<b)?a=b,1:0;}
template<typename T>bool cmin(T &a,T b){return (a>b)?a=b,1:0;}
template<typename T>T read()
{
	T ans=0,f=1;
	char ch=getchar();
	while(!isdigit(ch)&&ch!='-')ch=getchar();
	if(ch=='-')f=-1,ch=getchar();
	while(isdigit(ch))ans=(ans<<3)+(ans<<1)+(ch-'0'),ch=getchar();
	return ans*f;
}
template<typename T>void write(T x,char y)
{
	if(x==0)
	{
		putchar('0'),putchar(y);
		return;
	}
	if(x<0)
	{
		putchar('-');
		x=-x;
	}
	static char wr[20];
	int top=0;
	for(;x;x/=10)wr[++top]=x%10+'0';
	while(top)putchar(wr[top--]);
	putchar(y);
}
void file()
{
#ifndef ONLINE_JUDGE
	freopen("F.in","r",stdin);
	freopen("F.out","w",stdout);
#endif
}
int s;
void input()
{
	s=read<int>();
}
int dig[N];
const int mo=1e9+7;
int ans;
void add(int &x,int y){x+=y;x-=(x>=mo?mo:0);}
int Mod(int x){return x>=mo?x-mo:x;}
int power(int x,int y)
{
	int res=1;
	for(;y;x=1ll*x*x%mo,y>>=1)if(y&1)res=1ll*res*x%mo;
	return res;
}
void work()
{
	int now=0;
	For(i,1,N-5)dig[i]=dig[i/10]+1;
	for(int i=1,j=1;i<1e7;i++)
	{
		while(now<s)now+=dig[j],j++;
		if(now==s)ans++;
		now-=dig[i];
	}
	int num;
	For(i,1,s/8)
	{
		if(s%i==0)
		{
			num=Mod(power(10,s/i)-power(10,s/i-1)+mo);
			add(ans,Mod(num-i+1+mo));	
		}
		else add(ans,1);
	}
	write(ans,'\n');
}
int main()
{

	input();
	work();
	return 0;
}