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;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
char s[maxn];
int a[maxn];
long long pw[maxn];
long long sum[maxn][10];
long long g[maxn][10];
int n;
long long f[maxn][maxn];
long long dfs(int pos, int k, bool limit, int j) {
  if (k < 0) return 0;
  if (k > n - pos + 1) return 0;
  if (pos > n) return k > 0 ? 0 : 1;
  if (!limit && f[pos][k] != -1) return f[pos][k];
  int up = limit ? a[pos] : 9;
  long long ans = 0;
  for (int d = 0; d <= up; d++) {
    ans += dfs(pos + 1, k - (d >= j ? 1 : 0), limit && d == up, j);
    ans %= mod;
  }
  if (!limit) f[pos][k] = ans;
  return ans;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  pw[0] = 1;
  for (int i = 1; i < n; i++) {
    pw[i] = pw[i - 1] * 10 % mod;
  }
  for (int i = 1; i <= n; i++) {
    a[i] = s[i] - '0';
  }
  for (int j = 0; j < 10; j++) {
    for (int i = 1; i <= n; i++) {
      for (int k = 0; k <= n; k++) {
        f[i][k] = -1;
      }
    }
    for (int k = 1; k <= n; k++) {
      sum[k - 1][j] = dfs(1, k, true, j);
    }
    for (int i = n - 2; i >= 0; i--) {
      sum[i][j] += sum[i + 1][j];
      sum[i][j] %= mod;
    }
  }
  for (int j = 0; j < 10; j++) {
    for (int i = 0; i < n; i++) {
      g[i][j] = (sum[i][j] - (j == 9 ? 0 : sum[i][j + 1]) + mod) % mod;
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 10; j++) {
      ans += g[i][j] * j % mod * pw[i] % mod;
      ans %= mod;
    }
  }
  printf("%lld\n", ans);
  return 0;
}