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;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long fac[99][1005], ps[1005], c[1005][1005];
int f[1005], d[1005], len;
char s[1005];
long long ans = 0;
long long solve(int m, int d[]) {
  long long ans = 0;
  for (int i = 0; i <= 9; i++) {
    int dl = 0;
    for (int j = i + 1; j <= 9; j++) dl += d[j];
    for (int k = 0; k <= m; k++)
      ans = (ans + c[m][k] * fac[10][dl] % 1000000007 * ps[k + d[i]] %
                       1000000007 * i % 1000000007 * fac[90 - i * 9][m - k] %
                       1000000007) %
            1000000007;
  }
  return ans;
}
int main() {
  for (int i = 0; i <= 90; i++) {
    fac[i][0] = 1;
    for (int j = 1; j <= 1000; j++) fac[i][j] = fac[i][j - 1] * i % 1000000007;
  }
  ps[0] = 0;
  for (int i = 1; i <= 1000; i++)
    ps[i] = (ps[i - 1] + fac[10][i - 1]) % 1000000007;
  c[0][0] = 1;
  for (int i = 0; i <= 1000; i++) {
    c[i][0] = c[i][i] = 1;
    for (int j = 1; j <= i - 1; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 1000000007;
  }
  scanf("%s", s + 1);
  len = strlen(s + 1);
  for (int i = 1; i <= len; i++) f[i] = s[i] - '0';
  for (int i = 1; i <= len; i++) {
    for (int j = 0; j <= f[i] - 1; j++) {
      d[j]++;
      ans += solve(len - i, d);
      d[j]--;
    }
    d[f[i]]++;
  }
  sort(f + 1, f + 1 + len);
  long long now = 0;
  for (int i = 1; i <= len; i++) now = (now * 10 + f[i]) % 1000000007;
  printf("%lld\n", (ans + now) % 1000000007);
  return 0;
}