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 int readint() {
  int a = 0;
  char c = getchar(), f = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -f;
  for (; '0' <= c && c <= '9'; c = getchar())
    a = (a << 3) + (a << 1) + (c ^ 48);
  return a * f;
}
const int Mod = 1e9 + 7;
const int MaxN = 705;
int f[MaxN][2], g[MaxN][2];
int num[MaxN], n;
int solve(int d) {
  memset(g, 0, (n + 1) * 2 << 2);
  memset(f, 0, (n + 1) * 2 << 2);
  g[0][0] = 1;
  long long v;
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < 10; ++j)
      for (int p = j > num[i]; p < 2; ++p) {
        v = g[i - 1][p] * ((j > d) ? 10ll : 1);
        g[i][p | (j < num[i])] = (v + g[i][p | (j < num[i])]) % Mod;
        v = f[i - 1][p] * ((j >= d) ? 10ll : 1);
        if (j == d) v += 1ll * g[i - 1][p] * d;
        f[i][p | (j < num[i])] = (v + f[i][p | (j < num[i])]) % Mod;
      }
  return f[n][1];
}
char str[MaxN];
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  for (int i = 1; i <= n; ++i) num[i] = str[i] - '0';
  ++num[n];
  int ans = 0;
  for (int i = 1; i <= 9; ++i) ans = (ans + solve(i)) % Mod;
  printf("%d\n", ans);
  return 0;
}