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;
const long long maxm = 700 + 5;
const long long mod = 1e9 + 7;
long long d[maxm][maxm][2];
long long p[maxm];
char s[maxm];
long long n;
signed main() {
  ios::sync_with_stdio(0);
  for (long long i = 1; i < maxm; i++) p[i] = (p[i - 1] * 10 + 1) % mod;
  cin >> (s + 1);
  n = strlen(s + 1);
  for (long long i = 1; i <= n; i++) s[i] -= '0';
  long long ans = 0;
  for (long long j = 1; j <= 9; j++) {
    memset(d, 0, sizeof d);
    for (long long x = 0; x <= s[1]; x++) {
      d[1][x >= j][x == s[1]]++;
    }
    for (long long i = 1; i <= n - 1; i++) {
      for (long long k = 0; k <= i; k++) {
        for (long long l = 0; l < 2; l++) {
          if (!d[i][k][l]) continue;
          long long ma = (l ? s[i + 1] : 9);
          for (long long x = 0; x <= ma; x++) {
            d[i + 1][k + (x >= j)][l && (x == ma)] += d[i][k][l];
            d[i + 1][k + (x >= j)][l && (x == ma)] %= mod;
          }
        }
      }
    }
    for (long long k = 0; k <= n; k++) {
      ans += p[k] * (d[n][k][0] + d[n][k][1]) % mod;
      ans %= mod;
    }
  }
  cout << ans << endl;
  return 0;
}