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<iostream>
#include<cstdio>
using namespace std;
const int P=(1e9)+7,mid=25500000,lid=10000000;
#define mod(x) ((x%P+P)%P)
int bra,num[mid+2];
inline long long qw(int x) {
	long long ans=1,o=10;
	while(x) {
		if(x&1) ans=(ans*o)%P;
		o=(o*o)%P,x>>=1;
	}
	return ans;
}
inline int ans1() {
	int s=0,ans=0;
	for(int cnt=1,_pow=10,j=1; cnt<8; cnt++,j=_pow,_pow*=10) for(int i=j; i<_pow; i++) num[i]=cnt;
	for (int i=lid; i<=mid; i++) num[i]=8;
	for(int l=1,r=0; l!=lid && r!=mid; l++) {
		s-=num[l-1];
		while(s+num[r+1]<=bra && r<mid) s+=num[++r];
		if(s==bra) ans++;
	}
	return ans;
}
inline int ans2() {
	int lim=bra/8,ans=lim;
	for(int t=1; t<=lim; t++) if(!(bra%t)) ans=mod(ans+mod(1ll*qw(bra/t-1)*9)-t);
	return ans;
}
#define AKIOIakNoip() {scanf("%d",&bra),printf("%d\n",mod(ans1()+ans2()));}
int main() {
	AKIOIakNoip();
}