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;
void read(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -f;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  x *= f;
}
void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (!x) return;
  print(x / 10), putchar(x % 10 + 48);
}
void write(int x) {
  if (!x)
    putchar('0');
  else
    print(x);
  putchar('\n');
}
const int maxn = 700 + 10;
const int inf = 1e9;
const double eps = 1e-8;
const int mod = 1e9 + 7;
int f[maxn][maxn][10][2], n;
char s[maxn];
void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  scanf("%s", s + 1), n = strlen(s + 1);
  for (int i = 1; i <= n; i++) s[i] -= '0';
  for (int i = 1; i <= 9; i++) f[0][0][i][1] = 1;
  for (int k = 1; k <= 9; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 0; j <= i; j++) {
        if (j || s[i] < k) add(f[i][j][k][1], f[i - 1][j - (s[i] >= k)][k][1]);
        add(f[i][j][k][0], 1ll * f[i - 1][j][k][0] * k % mod);
        if (j) add(f[i][j][k][0], 1ll * f[i - 1][j - 1][k][0] * (10 - k) % mod);
        add(f[i][j][k][0], 1ll * f[i - 1][j][k][1] * min(k, (int)s[i]) % mod);
        if (j)
          add(f[i][j][k][0],
              1ll * f[i - 1][j - 1][k][1] * max(s[i] - k, 0) % mod);
      }
  int ans = 0;
  for (int k = 1; k <= 9; k++) {
    int r = 0;
    for (int i = 1; i <= n; i++) {
      r = (1ll * r * 10 + 1) % mod;
      ans = (ans + 1ll * r * (f[n][i][k][0] + f[n][i][k][1]) % mod) % mod;
    }
  }
  write(ans);
  return 0;
}