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;
int n, i, j;
char s[711];
long long poww[711], sum[711];
long long dp[2][711][2], ss, dd;
long long ans;
void add(long long& a, long long b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
}
void solve_with(int cf) {
  int i, j, k;
  memset(dp, 0, sizeof(dp));
  ss = 0;
  dd = 1;
  dp[ss][0][0] = 1;
  for (i = 1; i <= n; i++) {
    memset(dp[dd], 0, sizeof(dp[dd]));
    for (j = 0; j <= i; j++) {
      add(dp[dd][j + (s[i] - '0' < cf ? 1 : 0)][0], dp[ss][j][0]);
      for (k = 0; k < s[i] - '0'; k++)
        add(dp[dd][j + (k < cf ? 1 : 0)][1], dp[ss][j][0]);
      for (k = 0; k < 10; k++)
        add(dp[dd][j + (k < cf ? 1 : 0)][1], dp[ss][j][1]);
    }
    swap(ss, dd);
  }
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  poww[n] = 1;
  sum[n] = 1;
  for (i = n - 1; i > 0; i--) {
    poww[i] = (poww[i + 1] * 10) % 1000000007;
    sum[i] = (sum[i + 1] + poww[i]) % 1000000007;
  }
  for (int cf = 1; cf < 10; cf++) {
    solve_with(cf);
    for (i = 0; i <= n; i++) {
      ans += 1LL * (dp[ss][i][0] + dp[ss][i][1]) * sum[i + 1];
      ans %= 1000000007;
    }
  }
  printf("%lld", ans);
  return 0;
}