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>
#define MOD 1000000007
#define pb push_back
#define mp make_pair
typedef long long int ll;
using namespace std;

ll s;
ll sum[23000000];
ll nd(ll x){
    if(x==0) return 1;
    if(x==1) return 10;
    if(x%2){
        ll tmp = nd(x/2);
        return (((tmp*tmp)%MOD)*10)%MOD;
    }
    else {
        ll tmp = nd(x/2);
        return (tmp*tmp)%MOD;
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> s;
    if(s==1){
        cout << '9' << '\n';
        return 0;
    }
    ll l=1, r=1;
    ll cnt=0;
    ll cn = 1;
    for(int i=1;i<23000000;i++){
        sum[i] = sum[i-1]+cn;
        if(i==9 || i==99 || i==999 || i==9999 || i==99999 || i==999999 || i==9999999) cn++;
    }
    for(l=1;l<10000000;l++){
        while((sum[r]-sum[l-1])<s) r++;
        if((sum[r]-sum[l-1])==s) cnt = (cnt+1)%MOD;
    }
    cnt = (cnt+(s/8))%MOD;
    for(ll i=1;i<=(s/8);i++){
        if(!(s%i)){
            cnt = (cnt+((9*nd((s/i)-1))%MOD)+MOD-i)%MOD;
        }
    }
    cout << cnt << '\n';
    return 0;
}