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 N = 705, mod = 1e9 + 7;
char str[N];
long long f[N][N][10];
long long num[N], len;
long long dfs(long long pos, bool limit, long long sum, long long low) {
  if (!pos) return !sum;
  if (!limit && ~f[pos][sum][low]) return f[pos][sum][low];
  long long res = 0, tp = limit ? num[pos] : 9;
  for (long long i = 0; i <= tp; i++)
    res = (res + dfs(pos - 1, limit && (i == tp), sum - (i >= low), low)) % mod;
  if (!limit) f[pos][sum][low] = res;
  return res;
}
long long calc(char s[]) {
  long long res = 0;
  len = strlen(s + 1);
  num[0] = 0;
  for (long long i = 1, j = len; i <= len; i++, j--) num[j] = s[i] - '0';
  for (long long i = 1; i <= 9; i++)
    for (long long j = 1, now = 1; j <= len; j++, now = (now * 10 + 1) % mod)
      res = (res + dfs(len, 1, j, i) * now) % mod;
  return res;
}
signed main() {
  memset(f, -1, sizeof(f));
  scanf("%s", str + 1);
  printf("%lld\n", calc(str));
  return 0;
}