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;
int read() {
  int X = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') X = X * 10 + c - '0', c = getchar();
  return X * w;
}
const int N = 700 + 10;
const int mod = 1e9 + 7;
int qpow(int a, int b) {
  int c = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) c = 1ll * c * a % mod;
  return c;
}
void add(int& x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
int n;
char s[N];
int dp[N][N][10][2];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= 9; ++i) dp[0][0][i][1] = 1;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j <= i; ++j)
      for (int k = 1; k <= 9; ++k)
        for (int f = 0; f <= 1; ++f) {
          int u = f ? s[i + 1] - '0' : 9;
          for (int l = 0; l <= u; ++l)
            add(dp[i + 1][j + (l >= k)][k][f & (l == u)], dp[i][j][k][f]);
        }
  int ans = 0;
  for (int i = 1; i <= 9; ++i)
    for (int j = 1, w = 1; j <= n; ++j, w = (10ll * w + 1) % mod)
      ans = (ans + 1ll * (dp[n][j][i][0] + dp[n][j][i][1]) * w) % mod;
  printf("%d\n", ans);
  return 0;
}