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;
char s[702];
int n, N[702];
int dp[702][702][2], P10[702];
int ans;
void Mod(int &x) {
  if (x >= 1000000007) x -= 1000000007;
  if (x < 0) x += 1000000007;
}
void precomp() {
  P10[0] = 1;
  for (int i = 1; i <= n; ++i) P10[i] = (10LL * P10[i - 1]) % 1000000007;
}
void compDp() {
  reverse(N + 1, N + n + 1);
  for (int d = 1; d < 10; ++d) {
    memset(dp, 0, sizeof(dp));
    dp[0][0][1] = 1;
    dp[0][0][0] = 0;
    for (int i = 1; i <= n; ++i) {
      for (int c = 0; c < d; ++c) {
        dp[i][0][c <= N[i]] += dp[i - 1][0][1];
        Mod(dp[i][0][c <= N[i]]);
        dp[i][0][c < N[i]] += dp[i - 1][0][0];
        Mod(dp[i][0][c < N[i]]);
      }
      for (int big = 0; big < i; ++big)
        for (int c = 0; c < 10; ++c)
          if ((big + (c >= d)) > 0) {
            dp[i][big + (c >= d)][c <= N[i]] += dp[i - 1][big][1];
            Mod(dp[i][big + (c >= d)][c <= N[i]]);
            dp[i][big + (c >= d)][c < N[i]] += dp[i - 1][big][0];
            Mod(dp[i][big + (c >= d)][c < N[i]]);
          }
    }
    int sum = 0;
    for (int big = 1; big <= n; ++big) {
      sum += P10[big - 1];
      Mod(sum);
      ans = (1LL * sum * dp[n][big][1] + ans) % 1000000007;
    }
  }
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; ++i) N[i] = s[i] - '0';
  precomp();
  compDp();
  printf("%d\n", ans);
  return 0;
}