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;
inline int qr() {
  int x = 0, f = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    f |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return f ? -x : x;
}
const int mod = 1e9 + 7, N = 707;
int n;
long long mi0[N], mi1[N];
char s[N];
long long f[N][N][2];
long long ans = 0;
int main() {
  scanf("%s", s + 1), n = strlen(s + 1);
  mi0[0] = 1;
  for (register int i = 1; i <= n; i++) {
    mi0[i] = mi0[i - 1] * 10 % mod;
    mi1[i] = (mi1[i - 1] * 10 + 1) % mod;
  }
  for (register int k = 1; k <= 9; k++) {
    memset(f, 0, sizeof f);
    f[0][0][1] = 1;
    for (register int i = 0; i < n; i++) {
      for (register int j = 0; j <= i; j++) {
        for (register int l = 0; l <= 9; l++) {
          f[i + 1][j + (l == k)][0] =
              (f[i + 1][j + (l == k)][0] + f[i][j][0] * mi0[l > k] % mod) % mod;
          if (l < s[i + 1] - '0') {
            f[i + 1][j + (l == k)][0] =
                (f[i + 1][j + (l == k)][0] + f[i][j][1] * mi0[l > k] % mod) %
                mod;
          } else if (l == s[i + 1] - '0') {
            f[i + 1][j + (l == k)][1] =
                (f[i + 1][j + (l == k)][1] + f[i][j][1] * mi0[l > k] % mod) %
                mod;
          }
        }
      }
    }
    for (register int j = 0; j <= n; j++) {
      ans = (ans + mi1[j] * (f[n][j][0] + f[n][j][1]) % mod * k % mod) % mod;
    }
  }
  printf("%lld", ans);
  return 0;
}