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>
const int N = 705;
const int MOD = 1000000007;
int n, f[N][N][2], g[15][N], pre[N], a[N];
char str[N];
void solve(int now) {
  memset(f, 0, sizeof(f));
  f[0][0][1] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= i; j++) {
      if (f[i][j][0]) {
        for (int k = 0; k <= now; k++)
          (f[i + 1][j + 1][0] += f[i][j][0]) %= MOD;
        for (int k = now + 1; k <= 9; k++)
          (f[i + 1][j][0] += f[i][j][0]) %= MOD;
      }
      if (f[i][j][1]) {
        for (int k = 0; k < a[i + 1]; k++)
          if (k <= now)
            (f[i + 1][j + 1][0] += f[i][j][1]) %= MOD;
          else
            (f[i + 1][j][0] += f[i][j][1]) %= MOD;
        if (a[i + 1] <= now)
          (f[i + 1][j + 1][1] += f[i][j][1]) %= MOD;
        else
          (f[i + 1][j][1] += f[i][j][1]) %= MOD;
      }
    }
  for (int i = 0; i < n; i++)
    g[now + 1][i + 1] = (f[n][i][0] + f[n][i][1]) % MOD,
                   (g[now + 1][i + 1] += g[now + 1][i]) %= MOD;
}
void calc() {
  int ans = 0;
  for (int i = 1; i <= 9; i++)
    for (int j = 1; j <= n; j++)
      (ans += (long long)i * pre[j] % MOD * (g[i][j] - g[i + 1][j]) % MOD) %=
          MOD;
  ans += ans < 0 ? MOD : 0;
  printf("%d\n", ans);
}
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  for (int i = 1; i <= n; i++) a[i] = str[i] - '0';
  pre[1] = 1;
  for (int i = 2; i <= n; i++) pre[i] = (long long)pre[i - 1] * 10 % MOD;
  std::reverse(pre + 1, pre + n + 1);
  for (int i = 0; i < 9; i++) solve(i);
  calc();
  return 0;
}