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;
void File() {
  freopen("CF908G.in", "r", stdin);
  freopen("CF908G.out", "w", stdout);
}
const int maxn = 700 + 10;
const long long mod = 1e9 + 7;
int len;
char n[maxn];
long long dp[maxn][15][maxn][2], p[maxn], ans;
void init() {
  scanf("%s", n + 1);
  len = strlen(n + 1);
  for (int i = 1, i_end_ = len; i <= i_end_; ++i)
    p[i] = (p[i - 1] * 10 + 1) % mod;
}
void add(long long &_, long long __) {
  _ = _ + __;
  if (_ > mod) _ -= mod;
}
void work() {
  for (int i = 1, i_end_ = 9; i <= i_end_; ++i) dp[0][i][0][1] = 1;
  for (int i = 0, i_end_ = len; i <= i_end_; ++i)
    for (int j = 1, j_end_ = 9; j <= j_end_; ++j)
      for (int k = 0, k_end_ = i; k <= k_end_; ++k) {
        for (int f = 0, f_end_ = 9; f <= f_end_; ++f) {
          if (f + '0' <= n[i + 1]) {
            if (f + '0' < n[i + 1])
              add(dp[i + 1][j][k + (f >= j)][0], dp[i][j][k][1]);
            else {
              add(dp[i + 1][j][k + (f >= j)][1], dp[i][j][k][1]);
            }
          }
          add(dp[i + 1][j][k + (f >= j)][0], dp[i][j][k][0]);
        }
        if (i == len) {
          long long val = (dp[i][j][k][0] + dp[i][j][k][1]) * p[k] % mod;
          add(ans, val);
        }
      }
  printf("%lld\n", ans);
}
int main() {
  init();
  work();
  return 0;
}