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;
inline long long read() {
  register long long w = 1, x = 0, ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') w = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return x * w;
}
const long long MAXN = (long long)7e2 + 10;
const long long MOD = (long long)1e9 + 7;
const long long INF = 0x3f3f3f3f3f3f3f3f;
char s[MAXN];
long long n, ans, digit[MAXN], Dec[MAXN], divv[MAXN][10], f[MAXN][MAXN][10][2];
inline void Init() {
  cin >> s + 1;
  n = strlen(s + 1);
  for (register long long i = 1; i <= n; i++) {
    digit[i] = s[i] - '0';
  }
}
inline void DP() {
  Dec[0] = 1;
  for (register long long i = 1; i <= n; i++) {
    Dec[i] = Dec[i - 1] * 10 % MOD;
  }
  for (register long long i = 0; i <= 9; i++) {
    f[0][0][i][1] = 1;
  }
  for (register long long i = 0; i < n; i++) {
    for (register long long j = 0; j <= i; j++) {
      for (register long long x = 1; x <= 9; x++) {
        for (register long long l = 0; l <= 1; l++) {
          for (register long long k = 0; k <= (l ? digit[i + 1] : 9); k++) {
            f[i + 1][j + (k >= x)][x][(k == digit[i + 1]) && l] +=
                f[i][j][x][l];
            f[i + 1][j + (k >= x)][x][(k == digit[i + 1]) && l] %= MOD;
          }
        }
      }
    }
  }
  for (register long long x = 1; x <= 9; x++) {
    for (register long long j = 1; j <= n; j++) {
      for (register long long i = j; i <= n; i++)
        divv[j][x] = (divv[j][x] + f[n][i][x][1] + f[n][i][x][0]) % MOD;
    }
  }
  for (register long long i = 1; i <= n; i++) {
    for (register long long x = 1; x <= 9; x++) {
      ans = (ans + (divv[i][x] - divv[i][x + 1] + MOD) % MOD * Dec[i - 1] %
                       MOD * x % MOD) %
            MOD;
    }
  }
  printf("%lld\n", ans);
}
signed main() {
  Init();
  DP();
  return 0;
}