Problem: Let S(n) denote the number that represents the digits of n in sorted order. For example, S(1) = 1, S(5) = 5, S(50394) = 3459, S(353535) = 333555.

Given a number X, compute <image> modulo 109 + 7.

Input

The first line of input will contain the integer X (1 ≤ X ≤ 10700).

Output

Print a single integer, the answer to the question.

Examples

Input

21


Output

195


Input

345342


Output

390548434

Note

The first few values of S are 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 12. The sum of these values is 195. 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
char n[705];
long long len;
long long f[705][705][2];
long long ans = 0;
signed main() {
  scanf("%s", n + 1);
  len = strlen(n + 1);
  for (long long i = (1); i <= (9); ++i) {
    memset(f, 0, sizeof(f));
    for (long long j = (0); j <= (n[1] - '0'); ++j)
      ++f[1][j >= i][j == (n[1] - '0')];
    for (long long j = (2); j <= (len); ++j) {
      for (long long k = (0); k <= (j); ++k) {
        for (long long lim = (0); lim <= (1); ++lim) {
          long long to = lim ? n[j] - '0' : 9;
          for (long long w = (0); w <= (to); ++w) {
            f[j][k + (w >= i)][lim && w == to] =
                (f[j][k + (w >= i)][lim && w == to] + f[j - 1][k][lim]) % mod;
          }
        }
      }
    }
    long long p10 = 1;
    for (long long j = (1); j <= (len); ++j) {
      ans = (ans + p10 * (f[len][j][0] + f[len][j][1])) % mod;
      p10 = (p10 * 10 + 1) % mod;
    }
  }
  printf("%lld\n", ans);
  return 0;
}