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>
#define FOR(i, l, r) for(int i = l; i <= r; ++i)

using namespace std;

typedef long long ll;
const int N = 23000000;
const int mod = 1e9 + 7;

ll ans;
int dig[N + 10], po[10];
int S, sum, r;

ll pow(ll x, ll y, int mod)
{
    ll ans = 1;
    for(; y; y >>= 1)
    {
        if (y & 1) ans = ans * x % mod;
         x = x * x % mod;
    }
    return ans;
}

ll work(int x)
{
    int tmp = S / x;
    return (pow(10LL, tmp - 1, mod) * 9 - x + 1 + mod) % mod;
}

int main()
{
    scanf("%d", &S);
    po[0] = 1; FOR(i, 1, 7) po[i] = po[i - 1] * 10;
    FOR(i, 0, 7) dig[po[i]] = 1;
    FOR(i, 1, N) dig[i] += dig[i - 1];
    FOR(i, 1, po[7] - 1)
    {
        sum -= dig[i - 1];
        while (sum + dig[r + 1] <= S) sum += dig[++r];
        if (sum == S) ++ans;
    }
    int tmp = S / 8;
    FOR(i, 1, tmp)
        if (S % i == 0) (ans += work(i)) %= mod; else ++ans;
    printf("%lld\n", ans % mod);
    return 0;
}