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 M = 705;
const int P = (int)1e9 + 7;
int n, dp[M][M][2];
char str[M];
inline void Add(int &a, int b) {
  a += b;
  if (a >= P) a -= P;
}
int main() {
  int ans = 0;
  scanf("%s", str + 1);
  n = strlen(str + 1);
  reverse(str + 1, str + n + 1);
  for (int k = 1; k <= 9; k++) {
    memset(dp, 0, sizeof(dp));
    dp[0][0][0] = 1;
    for (int i = 0; i < n; i++)
      for (int j = 0; j <= i; j++) {
        for (int op = 0; op < 2; op++) {
          for (int t = 0; t <= 9; t++) {
            int nc = op;
            if (t < (str[i + 1] ^ 48)) nc = 0;
            if (t > (str[i + 1] ^ 48)) nc = 1;
            Add(dp[i + 1][j + (t >= k)][nc], dp[i][j][op]);
          }
        }
      }
    int num = 0;
    for (int j = 0; j <= n; j++) {
      ans = (ans + (long long)dp[n][j][0] * num % P) % P;
      num = ((long long)10 * num + 1) % P;
    }
  }
  printf("%d\n", ans);
  return 0;
}