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;
inline void In(long long _, ...) {
  va_list lis;
  va_start(lis, _);
  while (_--) scanf("%lld", va_arg(lis, long long*));
}
inline void Out(long long _, ...) {
  va_list lis;
  va_start(lis, _);
  while (_--) printf("%lld\n", va_arg(lis, long long));
}
inline void Out_(long long _, ...) {
  va_list lis;
  va_start(lis, _);
  while (_--) printf("%lld ", va_arg(lis, long long));
}
const long long P = 1E9 + 7;
string s;
long long f[750][750][10][2];
int main() {
  cin >> s;
  long long n = s.size();
  s = ' ' + s;
  for (int(i) = (0); (i) <= (9); ++(i)) f[0][0][i][0] = 1;
  for (int(i) = (0); (i) <= (n - 1); ++(i))
    for (int(j) = (0); (j) <= (i); ++(j))
      for (int(k) = (1); (k) <= (9); ++(k))
        for (int(flag) = (0); (flag) <= (1); ++(flag)) {
          long long maxi = 9;
          if (!flag) maxi = s[i + 1] - '0';
          for (int(p) = (0); (p) <= (maxi); ++(p)) {
            f[i + 1][j + (p >= k)][k][flag | (p < maxi)] =
                (f[i + 1][j + (p >= k)][k][flag | (p < maxi)] +
                 f[i][j][k][flag]) %
                P;
          }
        }
  long long ans = 0;
  for (int(k) = (1); (k) <= (9); ++(k)) {
    long long we = 1;
    for (int(j) = (1); (j) <= (n); ++(j)) {
      ans += (f[n][j][k][0] + f[n][j][k][1]) % P * we % P;
      ans %= P;
      we = (10ll * we + 1ll) % P;
    }
  }
  Out(1, ans);
}