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>
int n, i, j, k, nv, cnt[12];
long long an;
char s[777];
long long Pw(long long a, long long b) {
  long long v = 1;
  for (; b; b >>= 1, a = a * a % 1000000007)
    if (b & 1) v = v * a % 1000000007;
  return v;
}
long long cal(long long x, long long c, long long m) {
  return (Pw(10, c) * Pw(100 - 9 * x, m) - Pw(91 - 9 * x, m) + 1000000007) %
         1000000007 * x % 1000000007 * Pw(9, 1000000007 - 2) % 1000000007;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (i = 1; i <= n; cnt[s[i++] - '0']++)
    for (j = 0; j < s[i] - '0' + (i == n); j++) {
      cnt[j]++;
      nv = 0;
      for (k = 0; k < 10; k++)
        an =
            (an + cal(k, cnt[k], n - i) * Pw(10, i - nv - cnt[k])) % 1000000007,
        nv += cnt[k];
      cnt[j]--;
    }
  printf("%d", an);
}