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() {
  int f = 1, sum = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum * f;
}
inline long long readLL() {
  long long f = 1, sum = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1LL;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum * f;
}
string s;
int n, a[100005], buc[11];
long long p[100005][11], ans;
int main() {
  cin >> s;
  n = s.size();
  for (int i = 1; i <= n; i++) a[i] = s[n - i] - '0';
  int cnt = 1;
  while (a[cnt] == 9) a[cnt++] = 0;
  a[cnt]++;
  if (cnt > n) n++;
  reverse(a + 1, a + n + 1);
  for (int i = 1; i <= 10; i++) p[0][i] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= 10; j++)
      p[i][j] = p[i - 1][j] * (100 - j * 9) % 1000000007;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= 9; j++) {
      (ans += p[buc[j]][10] * p[n - i][j] % 1000000007 *
                  (10 * max(a[i] - j, 0) + min(a[i], j)) -
              a[i] * p[n - i][10]) %= 1000000007;
      buc[j] += a[i] >= j;
    }
  cout << (ans * 111111112 % 1000000007 + 1000000007) % 1000000007 << endl;
}