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 num[MaxN], n;
int solve(int d) {
  long long g0 = 1, f0 = 0, g1 = 0, f1 = 0;
  for (int i = 1, t; i <= n; ++i) {
    ;
    f1 = ((100 - 9 * d) * f1 + d * g1) % Mod;
    g1 = (91 - 9 * d) * g1 % Mod;
    ;
    f1 += (t = min(num[i], d)) * f0 % Mod;
    if (d < num[i]) f1 += d * g0 % Mod;
    f1 += (num[i] - t) * 10 * f0 % Mod;
    g1 += (t = min(num[i], d + 1)) * g0 % Mod;
    g1 += (num[i] - t) * 10 * g0 % Mod;
    ;
    f0 = (f0 * ((num[i] < d) ? 1 : 10) + (num[i] == d) * d * g0) % Mod;
    g0 = g0 * ((num[i] > d) ? 10 : 1) % Mod;
  }
  return f1 % Mod;
}
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;
}