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 long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const int N = 1010;
char x[N];
long long comb[N][N], pw[92][N], ps[N], ret;
int d[N];
int f[N], l;
long long solve(int m, int *d) {
  long long ret = 0;
  for (int i = 0; i < 10; i++) {
    int dl = 0;
    for (int j = i + 1; j < 10; j++) dl += d[j];
    for (int k = 0; k < m + 1; k++) {
      ret = (ret + comb[m][k] * ps[k + d[i]] % mod * i % mod * pw[10][dl] %
                       mod * pw[90 - i * 9][m - k]) %
            mod;
    }
  }
  return ret;
}
int main() {
  scanf("%s", x);
  for (int j = 0; j < 91; j++) {
    pw[j][0] = 1;
    for (int i = 1; i < 1000; i++) pw[j][i] = pw[j][i - 1] * j % mod;
  }
  for (int i = 1; i < 1000; i++) ps[i] = (ps[i - 1] + pw[10][i - 1]) % mod;
  for (int i = 0; i < 1001; i++) {
    comb[i][0] = 1;
    for (int j = 1; j < i + 1; j++)
      comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j]) % mod;
  }
  l = strlen(x);
  for (int i = 0; i < l; i++) f[i] = x[i] - '0';
  for (int i = 0; i < l; i++) {
    for (int j = 0; j < f[i]; j++) {
      d[j]++;
      ret += solve(l - i - 1, d);
      d[j]--;
    }
    d[f[i]]++;
  }
  sort(f, f + l);
  long long w = 0;
  for (int i = 0; i < l; i++) w = (w * 10 + f[i]) % mod;
  printf("%lld\n", (ret + w) % mod);
}