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 int N = 705, P = 1e9 + 7;
int n, a[N];
char s[N];
long long f[N][10][N][2];
long long dp(int i, int j, int k, int less) {
  if (k < 0) return 0;
  if (!i) return k == 0;
  long long& res = f[i][j][k][less];
  if (~res) return res;
  res = 0;
  for (int l = (0); l <= (less ? 9 : a[i]); l++)
    res = (res + dp(i - 1, j, k - (l >= j), less || l < a[i])) % P;
  return res;
}
long long calc(int i, int j, long long res = 0) {
  if (j < 10)
    for (int k = (i); k <= (n); k++) res = (res + dp(n, j, k, 0)) % P;
  return res;
}
int main() {
  scanf("%s", s + 1), n = strlen(s + 1);
  for (int i = (1); i <= (n); i++) a[i] = s[n + 1 - i] - 48;
  memset(f, -1, sizeof f);
  long long ans = 0, ten = 1;
  for (int i = (1); i <= (n); i++) {
    for (int j = (1); j <= (9); j++)
      ans = (ans + (calc(i, j) - calc(i, j + 1) + P) * ten % P * j) % P;
    ten = ten * 10 % P;
  }
  return cout << ans, 0;
}