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 long long M = 7e2 + 5;
const long long mod = 1e9 + 7;
char sz[M];
long long a[M], js;
inline long long read() {
  register long long x = 0, y = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') y = 0;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + (c ^ 48);
    c = getchar();
  }
  return y ? x : -x;
}
long long f[M][M][10];
long long dfs(long long pos, long long limit, long long sum, long long l) {
  if (!pos) return !sum % mod;
  if (!limit && ~f[pos][sum][l]) return f[pos][sum][l] % mod;
  long long up = limit ? a[pos] : 9;
  long long cnt = 0;
  for (long long i = 0; i <= up; i++)
    cnt = (cnt + dfs(pos - 1, limit && i == up, sum - (i >= l), l)) % mod;
  if (!limit) f[pos][sum][l] = cnt;
  return cnt % mod;
}
signed main() {
  scanf("%s", sz + 1);
  memset(f, -1, sizeof(f));
  long long len = strlen(sz + 1);
  for (long long i = 1; i <= len; i++) a[i] = sz[len - i + 1] - '0';
  a[0] = 0;
  for (long long i = 1; i <= 9; i++)
    for (long long j = 1, puz = 1; j <= len;
         j++, puz = (10ll * puz + 1ll) % mod)
      js = (js + dfs(len, 1, j, i) * puz % mod) % mod;
  printf("%lld\n", js);
  return 0;
}