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 <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <cassert>
#include <utility>
#include <iomanip>
#include <chrono>
#include <random>
#include <bitset>

using namespace std;

#define sz(x) (int) x.size()
#define unique(x) x.erase(unique(x.begin(), x.end()), x.end())
#define all(a) a.begin(), a.end()
#define sqr(x) ((x) * (x)) 
#define y1 aksjdaskdjksjfksdjf
#define left kdnvldvoiwejifejg
#define right lkdsjflksdjfdjfk
#define prev asdasfsadjkjsdfjs
#define tm aklsjdasjdasjdkdjjf
#define random_shuffle asdasdd

const int mod = (int) 1e9 + 7;

int s;
long long ans;

long long binpow(long long x, long long p) {
  long long res = 1;
  while (p) {
    if (p & 1) {
      res = (res * x) % mod;
      p--;
    } else {
      x = (x * x) % mod;
      p /= 2;
    }
  }
  return res % mod;
}

int subMod(int a, int b) {
  int res = a - b;
  return res < 0 ? res + mod : res;
}

int main() { 

  cin >> s;

  int r = 1; 
  int total = 1;
  int radd = 1, irem = 1;
  int pr = 10, pi = 10;
  for (int i = 1; i < 10 * 1000 *  1000; i++) {
    while (total < s) {
      r++;
      if (r % pr == 0) {
        radd++;
        pr *= 10;
      }
      total += radd;
    }
    if (total == s) {
      ans++;
    }
    if (i % pi == 0) {
      irem++;
      pi *= 10;
    }
    total -= irem;
  }

  for (int i = 1; i <= s / 8; i++) {
    if (s % i == 0) {
      long long num = 9ll * binpow(10, s / i - 1) % mod;
      num = subMod(num, i - 1);
      ans = (ans + num) % mod;
    } else {
      ans = (ans + 1) % mod;
    }
  }

  cout << ans << endl;

  return 0;
}