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;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const int mod = 1e9 + 7;
const int nax = 705;
int n;
int in[nax];
int dp[10][nax][nax][2];
int ten[nax];
void read() {
  string s;
  cin >> s;
  n = s.length();
  for (int i = 0; i < n; ++i) in[i] = s[i] - '0';
}
int main() {
  ten[0] = 1;
  for (int i = 1; i < nax; ++i) ten[i] = 10LL * ten[i - 1] % mod;
  read();
  int answer = 0;
  for (int at_most = 0; at_most <= 9; ++at_most) {
    dp[at_most][0][0][0] = 1;
    for (int i = 0; i < n; ++i)
      for (int cnt = 0; cnt <= i; ++cnt)
        for (int already_smaller = 0; already_smaller <= 1; ++already_smaller) {
          int me = dp[at_most][i][cnt][already_smaller];
          if (!me) continue;
          for (int new_digit = 0; new_digit <= 9; ++new_digit)
            if (already_smaller || (new_digit <= in[i])) {
              int& x = dp[at_most][i + 1][cnt + (new_digit <= at_most)]
                         [already_smaller || (new_digit < in[i])];
              x += me;
              if (x >= mod) x -= mod;
            }
        }
    for (int cnt = 0; cnt <= n; ++cnt) {
      int x = dp[at_most][n][cnt][0] + dp[at_most][n][cnt][1];
      if (x >= mod) x -= mod;
      if (!x) continue;
      debug() << " ["
              << "at_most"
                 ": "
              << (at_most)
              << "] "
                 " ["
              << "cnt"
                 ": "
              << (cnt)
              << "] "
                 " ["
              << "x"
                 ": "
              << (x) << "] ";
      for (int i = cnt; i < n; ++i) {
        int mul = ten[n - 1 - i];
        answer = (answer + (long long)mul * x) % mod;
      }
    }
  }
  printf("%d\n", answer);
}