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);
}
long long Pow(long long x, long long k) {
  long long ans = 1;
  for (; k; k >>= 1, x = x * x % _p)
    if (k & 1) (ans *= x) %= _p;
  return ans;
}
long long calc(int x, int k, int m) {
  return (Pow(10, k) * Pow(100 - 9 * x, m) % _p - Pow(91 - 9 * x, m)) % _p * x %
         _p * Pow(9, _p - 2) % _p;
}
char st[N];
int n, cnt[10], s = 0;
long long ans = 0;
int main() {
  scanf("%s", st + 1);
  n = strlen(st + 1);
  for (int i = (1); i <= (n); ++i) {
    for (int j = (0); j <= (st[i] - '0' - 1 + (i == n)); ++j) {
      cnt[j]++, s = 0;
      for (int k = (0); k <= (9); ++k) {
        s += cnt[k];
        (ans += Pow(10, i - s) * calc(k, cnt[k], n - i) % _p) %= _p;
      }
      cnt[j]--;
    }
    cnt[st[i] - '0']++;
  }
  printf("%I64d\n", ans);
  return 0;
}