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;
inline int read(void) {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f * x;
}
const int mod = 1e9 + 7;
int Len, ans;
int f[2][710][2];
long long mi10[710], num11[710];
char str[710];
long long calc(int digit) {
  memset(f, 0, sizeof f);
  f[0][0][1] = 1;
  for (int i = 0; i < Len; ++i) {
    memset(f[(i + 1) & 1], 0, sizeof f[(i + 1) & 1]);
    for (int j = 0; j <= i; ++j) {
      for (int l = 0; l < 10; ++l) {
        (f[(i + 1) & 1][j + (l == digit)][0] +=
         f[i & 1][j][0] * mi10[l > digit] % mod) %= mod;
        if (l < str[i + 1] - '0')
          (f[(i + 1) & 1][j + (l == digit)][0] +=
           f[i & 1][j][1] * mi10[l > digit] % mod) %= mod;
        if (l == str[i + 1] - '0')
          (f[(i + 1) & 1][j + (l == digit)][1] +=
           f[i & 1][j][1] * mi10[l > digit] % mod) %= mod;
      }
    }
  }
  long long temp = 0;
  for (int i = 0; i <= Len; ++i) {
    (temp += 1LL * (f[Len & 1][i][0] + f[Len & 1][i][1]) * num11[i] % mod *
             digit % mod) %= mod;
  }
  return temp;
}
int main() {
  mi10[0] = 1;
  for (int i = 1; i <= 700; ++i) {
    mi10[i] = mi10[i - 1] * 10 % mod;
    num11[i] = (num11[i - 1] * 10 + 1) % mod;
  }
  scanf("%s", str + 1);
  Len = strlen(str + 1);
  for (int i = 1; i < 10; ++i) {
    (ans += calc(i)) %= mod;
  }
  printf("%d\n", ans);
  return 0;
}