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 N = 720, Mod = 1e9 + 7;
int f[N][N][10], dig[N], cnt, Ans, v1[N];
inline int Dynamic(int d, int p, int k, int up, int f0) {
  if (p < 0) return 0;
  if (d == 0) return !f0 && !p;
  if (!up && !f0 && f[d][p][k] != -1) return f[d][p][k];
  int lim = (up ? dig[d] : 9), val = 0;
  for (int i = 0; i <= lim; i++)
    val = (val +
           Dynamic(d - 1, p - (i >= k), k, up & (i == lim), f0 & (i == 0))) %
          Mod;
  if (!f0 && !up) f[d][p][k] = val;
  return val;
}
int main(void) {
  char ch = ' ';
  while (isspace(ch)) ch = getchar();
  while (isdigit(ch)) dig[++cnt] = ch - 48, ch = getchar();
  reverse(dig + 1, dig + cnt + 1), memset(f, 0xff, sizeof f), v1[1] = 1;
  for (int i = 2; i <= cnt; i++) v1[i] = (v1[i - 1] * 10LL + 1) % Mod;
  for (int p = 1; p <= cnt; p++)
    for (int k = 1; k <= 9; k++)
      (Ans += 1LL * v1[p] * Dynamic(cnt, p, k, 1, 1) % Mod) %= Mod;
  return printf("%d\n", Ans) * 0;
}