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>
inline int in() {
  int k = 0;
  char ch = getchar();
  bool p = 1;
  while (ch < '-') ch = getchar();
  if (ch == '-') ch = getchar(), p = 0;
  while (ch > '-') k = k * 10 + ch - '0', ch = getchar();
  return p ? k : -k;
}
const int N = 705, YL = 1e9 + 7;
inline int MO(const int &x) { return x >= YL ? x - YL : x; }
inline void add(int &x, int y) {
  if ((x += y) >= YL) x -= YL;
}
inline void dec(int &x, int y) {
  if ((x -= y) < 0) x += YL;
}
int pw[N], a[N], n;
char s[N];
int dp[N][N][10][2];
int dfs(int d, int s, int v, int pd) {
  if (d == n + 1) return s == 0;
  if (s < 0) return 0;
  if (~dp[d][s][v][pd]) return dp[d][s][v][pd];
  int &res = dp[d][s][v][pd], ma = pd ? 9 : a[d];
  res = 0;
  for (int i = 0; i <= ma; ++i)
    add(res, dfs(d + 1, s - (i >= v), v, pd || i < ma));
  return res;
}
int main() {
  for (int i = 1; i <= 700; ++i) pw[i] = (10ll * pw[i - 1] + 1) % YL;
  scanf("%s", s + 1);
  n = strlen(s + 1);
  memset(dp, -1, sizeof dp);
  for (int i = 1; i <= n; ++i) a[i] = s[i] - '0';
  int ans = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= 9; ++j)
      ans = (1ll * pw[i] * dfs(1, i, j, 0) + ans) % YL;
  printf("%d\n", ans);
  return 0;
}