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;
long long modd = 1e9 + 7;
const int N = 700 + 9;
char s[N];
int num[N];
long long dp[N][12][N][2];
long long pw10[N];
int n;
void add(long long& x, long long y) { x = (x + y) % modd; }
long long solve() {
  pw10[0] = 1;
  for (int i = 1; i <= n; ++i) pw10[i] = pw10[i - 1] * 10 % modd;
  for (int i = 1; i <= n; ++i) num[i] = s[i] - '0';
  for (int k = 0; k <= 9; ++k) {
    dp[0][k][0][1] = 1;
  }
  for (int i = 0; i < n; ++i) {
    for (int k = 1; k <= 9; ++k) {
      for (int j = 0; j <= i; ++j) {
        for (int fg = 0; fg <= 1; ++fg) {
          int lim = fg ? num[i + 1] : 9;
          for (int p = 0; p <= lim; ++p) {
            int tj = j;
            if (p >= k) ++tj;
            add(dp[i + 1][k][tj][fg && p == lim], dp[i][k][j][fg]);
          }
        }
      }
    }
  }
  long long res = 0;
  for (int k = 1; k <= 9; ++k) {
    long long tem = 1;
    for (int i = 1; i <= n; ++i) {
      res =
          (res + (dp[n][k][i][0] + dp[n][k][i][1]) % modd * tem % modd) % modd;
      tem = (tem * 10 + 1) % modd;
    }
  }
  return res;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  printf("%lld", solve());
  return 0;
}