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 N = 700 + 100;
const long long mod = 1e9 + 7;
int n;
int a[N];
long long f[12][N][N][2], mi_10[N], g[12][N];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string ss;
  cin >> ss;
  n = ss.length();
  mi_10[0] = 1;
  for (int i = 1; i < N; i++) mi_10[i] = mi_10[i - 1] * 10 % mod;
  for (int i = 0; i < n; i++) a[i] = ss[n - i - 1] - '0';
  for (int x = 0; x <= 9; x++) {
    f[x][n][0][1] = 1;
    for (int i = n - 1; i >= 0; i--) {
      for (int j = 0; j <= n; j++) {
        for (int lim = 0; lim <= 1; lim++) {
          if (!lim) {
            f[x][i][j][0] = (f[x][i][j][0] + f[x][i + 1][j][0] * x % mod) % mod;
            f[x][i][j + 1][0] =
                (f[x][i][j + 1][0] + f[x][i + 1][j][0] * (10 - x) % mod) % mod;
          } else {
            if (a[i] >= x)
              f[x][i][j][0] =
                  (f[x][i][j][0] + f[x][i + 1][j][1] * x % mod) % mod;
            else {
              if (a[i] > 0)
                f[x][i][j][0] =
                    (f[x][i][j][0] + f[x][i + 1][j][1] * a[i] % mod) % mod;
              f[x][i][j][1] = (f[x][i][j][1] + f[x][i + 1][j][1]) % mod;
            }
            if (a[i] >= x) {
              if (a[i] > x)
                f[x][i][j + 1][0] =
                    (f[x][i][j + 1][0] + f[x][i + 1][j][1] * (a[i] - x) % mod) %
                    mod;
              f[x][i][j + 1][1] = (f[x][i][j + 1][1] + f[x][i + 1][j][1]) % mod;
            }
          }
        }
      }
    }
  }
  long long ans = 0;
  for (int x = 0; x <= 9; x++) {
    for (int i = n; i >= 0; i--) {
      g[x][i] = g[x][i + 1];
      g[x][i] += f[x][0][i][0] + f[x][0][i][1];
      g[x][i] %= mod;
    }
  }
  for (int i = 0; i < n; i++) {
    long long res = 0;
    for (int j = 0; j <= 9; j++) {
      res = (res + (g[j][i + 1] - g[j + 1][i + 1] + mod) % mod * j % mod *
                       mi_10[i] % mod) %
            mod;
    }
    ans = (ans + res) % mod;
  }
  cout << ans << '\n';
  return 0;
}