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 <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <string>
#define MOD 1000000007

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int main()
{
	int S;
	scanf("%d",&S);
	ll ret=0;
	int sum=0,tw=10,start=1;
	int nxt=10;
	int f=1,t=1;
	for(int i=1;i<100000000;i++)
	{
		if(i==nxt)
		{
			nxt*=10;
			t++;
		}
		sum+=t;
		while(sum>S)
		{
			sum-=f;
			start++;
			if(start==tw)
			{
				tw*=10;
				f++;
			}
		}
		if(sum==S) ret++;
	}
	//printf("%lld\n",ret);
	ll all=900000000;
	for(int k=8;k<=S;k++)
	{
		int mx=S/k;
		int t=S%k;
		if(t==0) mx--,t+=k;
		if(mx-t>=0)
		{
			ret+=(mx-t)/(k+1)+1;
			if(ret>=MOD) ret-=MOD;
			if(S%(k+1)==0)
			{
				int len=S/(k+1);
				ret+=all-len;
				if(ret<0) ret+=MOD;
				if(ret>=MOD) ret-=MOD;
			}
		}
		all=all*10LL%MOD;
	}
	printf("%lld\n",ret);
	return 0;
}