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 MAXN = 705, Mod = 1e9 + 7;
const double pie = acos(-1);
char buf[1 << 12], *pp1 = buf, *pp2 = buf, nc;
int ny;
inline char gc() { return getchar(); }
inline int read() {
  int x = 0;
  for (ny = 1; nc = gc(), (nc < 48 || nc > 57) && nc != EOF;)
    if (nc == 45) ny = -1;
  if (nc < 0) return nc;
  for (x = nc - 48; nc = gc(), 47 < nc && nc < 58 && nc != EOF;
       x = (x << 3) + (x << 1) + (nc ^ 48))
    ;
  return x * ny;
}
char s[MAXN];
int a[MAXN], len, S[MAXN], f[MAXN][MAXN][10][2], ans = 0;
int dfs(int x, int y, int k, int opt) {
  if (!x) return y == 0;
  if (y < 0) return 0;
  if (~f[x][y][k][opt]) return f[x][y][k][opt];
  int tmp = 0, Mx = opt ? a[x] : 9;
  for (int i = 0; i <= Mx; i++)
    tmp = (tmp + dfs(x - 1, y - (i >= k), k, opt && Mx == i)) % Mod;
  return f[x][y][k][opt] = tmp;
}
int main() {
  scanf("%s", s + 1), len = strlen(s + 1), memset(f, -1, sizeof(f));
  for (int i = 1; i <= len; i++)
    a[i] = s[len - i + 1] ^ 48, S[i] = (1ll * S[i - 1] * 10 + 1) % Mod;
  for (int i = 1; i <= 9; i++)
    for (int j = 1; j <= len; j++)
      ans = (ans + 1ll * dfs(len, j, i, 1) * S[j]) % Mod;
  cout << ans << '\n';
  return 0;
}