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;
const int maxn = 715;
const int mod = (1e9) + 7;
int n, m, i, j, t, k, s, one[maxn], a[maxn], c[15], su[15], yh[maxn][maxn],
    pw[15][maxn], ans;
char str[maxn];
void dfs(int x, bool y) {
  if (x == 0) {
    t = 0;
    for (int i = 9; i > 0; --i)
      ans = (ans + (one[t + c[i]] - one[t]) * 1ll * i) % mod, t += c[i];
    return;
  }
  if (!y) {
    for (int i = 9; i >= 0; --i) su[i] = su[i + 1] + c[i];
    for (int i = 1; i <= 9; ++i) {
      for (int j = 0; j <= x; ++j)
        ans = (ans + 1ll * one[j + su[i]] * yh[x][j] % mod * pw[10 - i][j] %
                         mod * pw[i][x - j]) %
              mod;
    }
    return;
  }
  for (int i = 0; i <= a[x]; ++i) {
    ++c[i];
    dfs(x - 1, i == a[x]);
    --c[i];
  }
}
int main() {
  one[0] = 0;
  for (i = 0; i <= 10; ++i) pw[i][0] = 1;
  for (i = 1; i < maxn; ++i) {
    one[i] = (one[i - 1] * 10ll + 1ll) % mod;
    for (j = 0; j <= 10; ++j) pw[j][i] = 1ll * j * pw[j][i - 1] % mod;
  }
  yh[0][0] = 1;
  for (i = 1; i < maxn; ++i) {
    yh[i][0] = yh[i][i] = 1;
    for (j = 1; j < i; ++j) yh[i][j] = (yh[i - 1][j - 1] + yh[i - 1][j]) % mod;
  }
  scanf("%s", str + 1);
  n = strlen(str + 1);
  reverse(str + 1, str + n + 1);
  for (i = 1; i <= n; ++i) a[i] = str[i] - '0';
  dfs(n, 1);
  ans = (ans % mod + mod) % mod;
  printf("%d\n", ans);
  return 0;
}