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;
inline int read() {
  int first = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = 0;
    c = getchar();
  }
  while (isdigit(c)) first = first * 10 + c - '0', c = getchar();
  return f ? first : -first;
}
char s[705];
int d[705], dp[705][705][10];
void fmod(int& first) {
  first -= 1000000007, first += first >> 31 & 1000000007;
}
int qpow(int n, int k) {
  int res = 1;
  for (; k; k >>= 1, n = 1ll * n * n % 1000000007)
    if (k & 1) res = 1ll * n * res % 1000000007;
  return res;
}
int dfs(int pos, int limit, int sum, int low) {
  if (!pos) return !sum;
  if (!limit && ~dp[pos][sum][low]) return dp[pos][sum][low];
  int res = 0, up = limit ? d[pos] : 9;
  for (int i = 0; i <= up; ++i)
    fmod(res += dfs(pos - 1, limit && i == up, sum - (i >= low), low));
  if (!limit) dp[pos][sum][low] = res;
  return res;
}
int solve(char* s) {
  int res = 0;
  d[0] = 0;
  int n = strlen(s + 1);
  for (int i = 1, j = n; i <= n; ++i, --j) d[j] = s[i] - '0';
  for (int i = 1; i <= 9; ++i)
    for (int j = 1, now = 1; j <= n; ++j, now = (10ll * now + 1) % 1000000007)
      fmod(res += 1ll * dfs(n, 1, j, i) * now % 1000000007);
  return res;
}
signed main() {
  memset(dp, -1, sizeof(dp));
  scanf("%s", s + 1);
  printf("%d\n", solve(s));
}