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;
template <typename T>
inline T read() {
  T x = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
  return x * f;
}
const int inf = 1e9 + 1e7, MAXN = 7e2 + 1e1, Mod = 1e9 + 7;
const long long int INF = 1e18 + 1e9;
long long int dp[MAXN][MAXN][2], f[MAXN][11], Pow[MAXN], tmp, Ans;
int T[MAXN][MAXN][2], a[MAXN], n, num, Tcnt;
string s;
long long int Dfs(int dep, int s, bool lim) {
  if (!dep) return (!s);
  if (T[dep][s][lim] == Tcnt) return dp[dep][s][lim];
  long long int res = 0ll;
  for (int i = 0; i <= (lim ? a[dep] : 9); i++) {
    if (i < num) (res += Dfs(dep - 1, s, lim & (i == a[dep]))) %= Mod;
    if (i >= num && s) (res += Dfs(dep - 1, s - 1, lim & (i == a[dep]))) %= Mod;
  }
  T[dep][s][lim] = Tcnt, dp[dep][s][lim] = res;
  return res;
}
int main(void) {
  cin >> s;
  n = s.length(), Pow[0] = 1ll;
  for (int i = 0; i < n; i++) a[n - i] = s[i] ^ 48;
  for (int i = 0; i < n; i++) Pow[i + 1] = Pow[i] * 10ll % Mod;
  for (int i = 1; i < 10; i++) {
    ++Tcnt;
    for (int j = 1; j <= n; j++) num = i, f[j][i] = Dfs(n + 1, j, true);
  }
  for (int i = 1; i < 10; i++)
    for (int j = 1; j <= n; j++, tmp = 0ll) {
      for (int k = j; k <= n; k++)
        (tmp += (f[k][i] - f[k][i + 1] + Mod) % Mod) %= Mod;
      (Ans += tmp * i % Mod * Pow[j - 1] % Mod) %= Mod;
    }
  printf("%lld\n", Ans);
  return 0;
}