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>
inline int mod(int x) { return x < 1000000007 ? x : x - 1000000007; }
using namespace std;
int a[707][9], b[707][9], c[707], i, j, k, n, x;
char m[707];
int main() {
  scanf("%s", m), n = strlen(m), reverse(m, m + n);
  for (i = n; i; i--)
    for (j = 0, m[i - 1] ^= 48; j < 9; j++) {
      for (k = 0, c[i - 1] = (c[i] * 10ll + m[i - 1]) % 1000000007;
           k < m[i - 1]; k++)
        if (j < k)
          a[i - 1][j] = (a[i - 1][j] + 10ll * b[i][j] + 1) % 1000000007;
        else
          a[i - 1][j] = mod(a[i - 1][j] + b[i][j]);
      if (j < k)
        b[i - 1][j] = (10ll * b[i][j] + 1) % 1000000007;
      else
        b[i - 1][j] = b[i][j];
      for (k = 0; k <= j; k++) a[i - 1][j] = mod(a[i - 1][j] + a[i][j]);
      for (; k < 10; k++)
        a[i - 1][j] = (a[i - 1][j] + 10ll * a[i][j] + c[i]) % 1000000007;
    }
  for (i = 0; i < 9; i++) x = mod(x + mod(a[0][i] + b[0][i]));
  return 0 & printf("%d\n", x);
}