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;
template <class T>
inline void read(T& x) {
  int f = 1;
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
const int N = 700 + 5;
const int mo = 1000000007;
int n, len, ans;
char s[N];
int v[N][11][N][2];
int f[N][11][N][2];
int F[N][11];
int pw[N];
int dfs(int n, int c, int k, int lim) {
  if (k < 0) return 0;
  if (n == len + 1) return k == 0 ? 1 : 0;
  if (v[n][c][k][lim]) return f[n][c][k][lim];
  v[n][c][k][lim] = 1;
  int ans = 0, up = lim ? s[n] - '0' : 9;
  for (int i = 0; i <= up; i++)
    (ans += dfs(n + 1, c, k - (i >= c), lim & (i == up))) %= mo;
  return f[n][c][k][lim] = ans;
}
int main() {
  scanf("%s", s + 1);
  n = len = strlen(s + 1);
  for (int j = 0; j <= 10; j++) {
    for (int i = 0; i <= n; i++) F[i][j] = dfs(1, j, i, 1);
    for (int i = 1; i <= n; i++) (F[i][j] += F[i - 1][j]) %= mo;
  }
  pw[0] = 1;
  for (int i = 1; i <= n; i++) pw[i] = 1LL * pw[i - 1] * 10 % mo;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < 10; j++) {
      int tmp = 1LL * pw[n - i] * j % mo, k = n - i;
      (ans += 1LL * tmp * ((F[k][j + 1] - F[k][j]) % mo) % mo) %= mo;
    }
  }
  printf("%d\n", (ans + mo) % mo);
  return 0;
}