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>
const int N = 705, djq = 1e9 + 7;
int n, f[N][N][2], a[N], g[10][N], pw[N], ans;
char s[N];
inline void add(int &a, const int &b) {
  if ((a += b) >= djq) a -= djq;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) a[i] = s[n - i + 1] - '0';
  for (int d = 0; d < 10; d++) {
    f[0][0][0] = 1;
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j <= i; j++) f[i][j][0] = f[i][j][1] = 0;
      for (int j = 0; j < i; j++)
        for (int c = 0; c < 10; c++) {
          add(f[i][j + (c >= d)][c > a[i]], f[i - 1][j][0]);
          add(f[i][j + (c >= d)][c >= a[i]], f[i - 1][j][1]);
        }
    }
    for (int i = 0; i <= n; i++) g[d][i] = f[n][i][0];
  }
  pw[1] = 1;
  for (int i = 2; i <= n; i++) pw[i] = 10ll * pw[i - 1] % djq;
  for (int i = 2; i <= n; i++) add(pw[i], pw[i - 1]);
  for (int d = 0; d < 10; d++) {
    int delta = 0;
    for (int i = 0; i <= n; i++) {
      delta = (1ll * pw[i] * g[d][i] + delta) % djq;
      if (d < 9) delta = (delta - 1ll * pw[i] * g[d + 1][i] % djq + djq) % djq;
    }
    ans = (1ll * delta * d + ans) % djq;
  }
  return std::cout << ans << std::endl, 0;
}