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;
namespace SHENZHEBEI {
const int L = 2333333;
char SZB[L], *S = SZB, *T = SZB;
inline char gc() {
  if (S == T) {
    T = (S = SZB) + fread(SZB, 1, L, stdin);
    if (S == T) return '\n';
  }
  return *S++;
}
inline long long read() {
  long long x = 0, f = 1;
  char ch = gc();
  for (; !isdigit(ch); ch = gc())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = gc()) x = x * 10 - 48 + ch;
  return x * f;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline char readchar() {
  char ch = gc();
  for (; isspace(ch); ch = gc())
    ;
  return ch;
}
inline long long readstr(char *s) {
  char ch = gc();
  int cur = 0;
  for (; isspace(ch); ch = gc())
    ;
  for (; !isspace(ch); ch = gc()) s[cur++] = ch;
  s[cur] = '\0';
  return cur;
}
inline void writeln(long long x) {
  write(x);
  puts("");
}
}  // namespace SHENZHEBEI
using namespace SHENZHEBEI;
const long long N = 710, mod = 1e9 + 7;
char s[N];
long long f[N][N][2], ans, n;
int main() {
  n = readstr(s + 1);
  for (long long d = 1; d <= 9; ++d) {
    memset(f, 0, sizeof f);
    f[0][0][1] = 1;
    for (long long i = 0; i <= n; ++i)
      for (long long j = 0; j <= i; ++j)
        for (long long opt = 0; opt <= 1; ++opt)
          for (long long now = 0; now <= (opt ? s[i + 1] - '0' : 9); ++now)
            (f[i + 1][j + (now >= d)][opt && now == s[i + 1] - '0'] +=
             f[i][j][opt]) %= mod;
    for (long long i = 1, val = 1; i <= n; ++i, val = (val * 10 + 1) % mod)
      (ans += (f[n][i][0] + f[n][i][1]) * val) %= mod;
  }
  writeln(ans);
}