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;
#define maxn 23000000
#define int long long
#define mod 1000000007
int digit[maxn], ans, S;

int read()
{
	int x = 0, k = 1;
	char c; c = getchar();
	while(c < '0' || c > '9') { if(c == '-') k = -1; c = getchar(); }
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * k;
}

int Qpow(int times)
{
	int x = 10, base = 1;
	for(; times; times >>= 1, x = x * x % mod)
		if(times & 1) base = base * x % mod;
	return base;
}

void Up(int &x, int y) { x = (x + y) % mod; }
signed main()
{
    S = read(); int lim = S / 8, now = 0;
    for(int i = 1; i < maxn; i ++) digit[i] = digit[i / 10] + 1;
    for(int i = 1, now = 0, tem = 0; i < 1e7; i ++)
    {
    	while(tem < S) { tem += digit[now]; now ++; }
		if(tem == S) { ans += 1; if(ans >= mod) ans -= mod; } 
		tem -= digit[i];
    }
    for(int i = 1; i <= lim; i ++)
	{
		if(!(S % i)) 
		{
			int l = S / i, sum = Qpow(l - 1) * 9 % mod;
			if(l < 8) continue;
			Up(ans, (sum - i + 1 + mod) % mod);
		}
		else 
		{ 
			int l = (S - S % i) / i; if(l < 8) continue;
			ans += 1; if(ans >= mod) ans -= mod; 
		}
	}
	printf("%lld\n", ans);
	return 0;
}