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 oo = 0x3f3f3f3f;
const long long ooo = 9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N = 200005;
const double PI = acos(-1.0);
const double eps = 1e-9;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
char st[705];
int n, x;
long long ans = 0, g[705], dp[705][2];
int main() {
  scanf("%s", st + 1), n = strlen(st + 1);
  for (int i = (1); i <= (n); ++i)
    g[i] = g[i - 1] * 10 + st[i] - '0', g[i] %= _p;
  for (int k = (1); k <= (9); ++k) {
    memset(dp, 0, sizeof(dp));
    for (int i = (0); i <= (n - 1); ++i) {
      x = st[i + 1] - '0';
      (dp[i + 1][0] += dp[i][0] * k + dp[i][1] * ((x) < (k) ? (x) : (k))) %= _p;
      (dp[i + 1][0] += (dp[i][0] * 10 + g[i]) * (10 - k)) %= _p;
      (dp[i + 1][0] += (dp[i][1] * 10 + 1) * (x - ((x) < (k) ? (x) : (k)))) %=
          _p;
      (dp[i + 1][1] += (x < k) ? dp[i][1] : (dp[i][1] * 10 + 1)) %= _p;
    }
    (ans += dp[n][0] + dp[n][1]) %= _p;
  }
  printf("%I64d\n", ans);
  return 0;
}