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;
char x[700 + 1];
int ten[700 + 1];
int sfx[700 + 1];
int f[700 + 1][700 + 1];
int ans;
void read() {
  scanf("%s", x);
  n = strlen(x);
  for (int i = 0; i < n; ++i) x[i] -= '0';
  for (int i = 0; i < (n >> 1); ++i) {
    int s = x[i];
    x[i] = x[n - i - 1];
    x[n - i - 1] = s;
  }
}
void chief() {
  int p = 1;
  ten[0] = p;
  for (int i = 1; i <= n; ++i) {
    p = (long long)p * 10 % 1000000007;
    ten[i] = p;
  }
  long long s = 0;
  for (int i = 0; i < n; ++i) {
    s += (long long)ten[i] * x[i];
    s %= 1000000007;
    sfx[i] = s;
  }
  ans = 0;
  for (int cd = 1; cd <= 9; ++cd) {
    for (int i = 0; i <= n; ++i) {
      f[i][0] = ten[i];
      for (int l = 1; l <= i; ++l)
        f[i][l] = (cd * (long long)f[i - 1][l] +
                   (10 - cd) * (long long)f[i - 1][l - 1]) %
                  1000000007;
    }
    for (int l = 1; l <= n; ++l) {
      long long s = 0;
      int rl = l;
      for (int i = n - 1; i >= 0; --i) {
        if (rl == 0) {
          s += sfx[i];
          s %= 1000000007;
          break;
        }
        if (x[i] <= cd)
          s += (long long)x[i] * f[i][rl];
        else
          s += (long long)cd * f[i][rl] + (long long)(x[i] - cd) * f[i][rl - 1];
        s %= 1000000007;
        rl -= (x[i] >= cd) ? 1 : 0;
      }
      if (rl == 0) s += 1;
      s %= 1000000007;
      s *= ten[l - 1];
      s %= 1000000007;
      ans = ((long long)ans + s) % 1000000007;
    }
  }
}
void write() { printf("%d\n", ans); }
int main() {
  read();
  chief();
  write();
  return 0;
}