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>
const long long MOD = 1000000007;
const int MAX_LENGTH = 701;
long long Unu[1 + MAX_LENGTH];
long long Count[1 + MAX_LENGTH][10][1 + MAX_LENGTH][2];
int main() {
  char n[1 + MAX_LENGTH + 1];
  scanf("%s", n + 1);
  int nrCifN = strlen(n + 1);
  std::reverse(n + 1, n + 1 + nrCifN);
  for (int cif = 1; cif <= nrCifN; cif++) {
    n[cif] -= '0';
  }
  Unu[0] = 0;
  for (int cif = 1; cif <= nrCifN; cif++) {
    Unu[cif] = (Unu[cif - 1] * 10 + 1) % MOD;
  }
  for (int d2 = 0; d2 < 10; d2++) {
    Count[0][d2][0][true] = 1;
  }
  for (int d2 = 0; d2 < 10; d2++) {
    for (int cif = 1; cif <= nrCifN; cif++) {
      for (int d = 0; d < d2; d++) {
        Count[cif][d2][0][d <= n[cif]] += Count[cif - 1][d2][0][true];
        Count[cif][d2][0][d < n[cif]] += Count[cif - 1][d2][0][false];
      }
      Count[cif][d2][0][true] %= MOD;
      Count[cif][d2][0][false] %= MOD;
      for (int mari = 1; mari <= nrCifN; mari++) {
        for (int d = 0; d < 10; d++) {
          Count[cif][d2][mari][d <= n[cif]] +=
              Count[cif - 1][d2][mari - (d >= d2)][true];
          Count[cif][d2][mari][d < n[cif]] +=
              Count[cif - 1][d2][mari - (d >= d2)][false];
        }
        Count[cif][d2][mari][true] %= MOD;
        Count[cif][d2][mari][false] %= MOD;
      }
    }
  }
  long long answer = 0;
  for (int d2 = 1; d2 < 10; d2++) {
    for (int mari = 0; mari <= nrCifN; mari++) {
      answer += Unu[mari] * Count[nrCifN][d2][mari][true];
      answer %= MOD;
    }
  }
  printf("%lld\n", answer);
  return 0;
}